Hibernate / JPA
Learn JPA and Hibernate: entities, the persistence context, mappings, relationships, lazy loading and N+1 fixes, JPQL, transactions, locking and Spring Data.
What you'll learn
- Explain ORM, Jakarta Persistence, Hibernate and Spring Data JPA, and configure them with schema migrations.
- Map entities with IDs, enums, embeddables, converters and inheritance strategies.
- Work with the persistence context: entity states, persist, merge, dirty checking and flushing.
- Map relationships correctly with owning sides, cascades, orphan removal and safe equality.
- Fetch data efficiently with lazy loading, join fetch, entity graphs, batch fetching and DTO projections.
- Write JPQL, Criteria and native queries, and manage transactions, locking, caching and tests.
Syllabus
ORM, JPA and Hibernate
The Persistence Context
- EntityManager Operations
- Entity States and Dirty Checking
- Flushing, the First-Level Cache and Transactions
Mapping Types, Keys and Inheritance
- Basic Types, Enums, Embeddables and Converters
- Primary Keys and ID Generation
- Inheritance Mapping Strategies
Relationships
- @ManyToOne, @OneToMany and the Owning Side
- Many-to-Many and One-to-One
- Cascades, Orphan Removal and Entity Equality