Hibernate / JPA

Learn JPA and Hibernate: entities, the persistence context, mappings, relationships, lazy loading and N+1 fixes, JPQL, transactions, locking and Spring Data.

कोर्स शुरू करें →

आप क्या सीखेंगे

  • 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.

पाठ्यक्रम

ORM, JPA and Hibernate

  1. Why ORM, and What JPA and Hibernate Are
  2. Setting Up JPA with Spring Boot
  3. Your First Entity

The Persistence Context

  1. EntityManager Operations
  2. Entity States and Dirty Checking
  3. Flushing, the First-Level Cache and Transactions

Mapping Types, Keys and Inheritance

  1. Basic Types, Enums, Embeddables and Converters
  2. Primary Keys and ID Generation
  3. Inheritance Mapping Strategies

Relationships

  1. @ManyToOne, @OneToMany and the Owning Side
  2. Many-to-Many and One-to-One
  3. Cascades, Orphan Removal and Entity Equality

Fetching and Performance

  1. Lazy and Eager Loading
  2. The N+1 Select Problem
  3. DTO Projections and Read Models

Querying

  1. JPQL Essentials
  2. Criteria API and Specifications
  3. Native SQL and Bulk Operations

Transactions, Locking and Caching

  1. Transactions with Spring and JPA
  2. Optimistic and Pessimistic Locking
  3. Second-Level and Query Caching

Spring Data JPA, Performance, Testing and Revision

  1. Spring Data JPA Repositories
  2. Performance Checklist
  3. Testing the Persistence Layer
  4. Revision and Interview Questions