Advanced Hibernate (Project Objective)

Inheritance in JPA/Hibernate

Hibernate supports four inheritance strategies to enhance reusability in the entity layer:

  1. MappedSuperclass
  2. Single Table
  3. Joined
  4. Table per Class

First Inheritance Strategy: jakarta.persistence.MappedSuperclass

Review Note: The MappedSuperclass section is complete, covering the annotation, its purpose, and typical fields. No additional inheritance strategies (Single Table, Joined, Table per Class) were detailed in the input, so I’ll focus on MappedSuperclass as provided. If you need details on the other strategies, let me know.


Associations between Entities (HAS-A)

Associations represent a weaker form of association (aggregation) since entities have standalone lifecycles and separate database identities (tables with primary keys).

Reference: Food Delivery App

2.1 Establish Bidirectional One-to-Many and Many-to-One Association