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.
Types of inheritance mapping –
- Single Table Mapping or table per class
- Table Per Subclass
- Table Per Concrete Class
- Hibernate/JPA Single Table Inheritance Mapping Example Using Spring Boot and Oracle.
- Hibernate/JPA Table Per Subclass Mapping Example Using Spring Boot And Oracle.
- Hibernate/JPA Table Per Concrete Class Mapping Example Using Spring Boot And Oracle.