Inheritance Mapping in Hibernate

When multiple entities are in inheritance relationship then we can use inheritance mapping. Suppose we have three entities in inheritance relationship Book.java, OldBook.java and NewBook.java. Normally we will have three tables for each entity, in case of inheritance mapping, we can map all entity into a single table or we can have a separate table for each entity, It depends on requirement.

Inheritance Mapping in Hibernate

Types of inheritance mapping –

  1. Single Table Mapping or table per class
  2. Table Per Subclass
  3. Table Per Concrete Class