Training » All Courses » Java » Hibernate » Hibernate Bootcamp

Course Summary

Hibernate Bootcamp is composed of the following components:
Jump To: Duration Outline

Duration

6 days.

2 course(s)

Outline

Hibernate   (3 days)

Day 1
  • Hibernate and J2EE - How we got here, why Hibernate, the bigger picture
  • Objects and Persistence - Object Relational Mapping
  • Hibernate Architecture
  • Download, Install and Configure
  • First look application
Day 2
  • Understanding Hibernate database connections
  • Hibernate mapping documents
  • Creating persistent classes
  • Mapping collections of objects
  • The persistent object lifecycle
Day 3
  • Hibernate Query Language
  • Caching objects with Hibernate
  • Transactions and Locking
  • Hibernate extensions and development toolsets
  • Bringing it all together - CDTest Swing-app and CDViewer web-app

Advanced Hibernate   (3 days)

Hibernate - Revisited

  • Revisit the role Hibernate plays in our applications
  • Revisit JPA
    • Entity Manager
  • Getting started with a simple Hibernate application
    • Configuration
    • API
    • Mapping a simple class
      • XML vs Annotations
    • Common type mappings
    • Inserting and updating
    • Retrieving persistent objects

Advanced Property and Relationship Mappings

  • Mapping advanced Java data types
  • Mapping inter-entity relationships
    • One to one, one to many, many to one, many to many
    • Parent - child
    • Collections
    • Bidirectional
    • Cascading Operations
    • Transitive persistence
    • Lazy and eager loading
    • Collections of value objects
      • Modeling a set of simple values
      • Mapping collections of components
  • Mapping inheritance
    • Polymorphic support
    • Exploring pros and cons of different strategies
      • Single table
      • Table per subclass
      • Table per concrete class

The Persistance Lifecycle

  • Hibernate Object States
    • Transient, Persistent, Detached, Removed
    • Transitions between states
  • Persistance Context (Session)
    • Lifecycle
    • Acquiring a Session
    • Session per request
    • Session Propagation
    • As Cache
    • Synchronization with the database
    • Flushing
    • Object Identity

Protecting Data

  • Transactions in Hibernate
    • Lifecycle
    • Demarcation
    • API
  • Optimistic vs. Pessimistic locking
  • Versioning
  • Integrating with external transaction managers
    • Managed environment

Finding Your Data

  • Simple "searching" by ID (Session API)
  • Advanced HQL
    • Revisited (syntax and API)
    • Parameters
    • Joins
    • Named queries
    • Functions (e.g. aggregate)
    • Projections (tuples)
  • Searching by example
  • Native queries
  • Criteria API
    • Uses
    • Restrictions
    • Associations
    • Ordering
    • Fetching
  • Filters
    • Defining and attaching filters
    • Using filters
    • Mapping filters to a set
    • Collection filters

Tuning Your Code

  • Fetching strategies: lazy, eager, batch, sub-query loading
  • Caching
    • Second-level Cache
    • Query Caching
    • Data-appropriate caching
    • Cache Providers
    • Cache Configuration
    • Managing caches
  • Query Efficiency
  • N+1 Select Problem
  • Design Considerations
    • Long conversations
    • Session-per-conversation
      • Open Session In View Pattern

Best Practices

  • Entity identity: implementing equals() and hashCode()
  • Designing your DAO layer
  • Troubleshooting problems
  • Testing your DAO code
  • Logging
  • Hibernate Toolset
    • Installing
    • Class Diagram
    • HQL Editor
    • Query Results
    • SQL Preview
  • Q&A