Java being an Object Oriented Language, it supports one of the most powerful concept “Inheritance“. Object Oriented Systems generally supports both IS-A and HAS-A relationships, whereas Relational Model supports only HAS-A relationship. Hibernate can help you map such kind of entities into the Relational table based on the strategy selected.
Types of Inheritance in Hibernate
Hibernate offers 3 different approaches for mapping this kind of hierarchical classes.
- Table per Class hierarchy
- Table per Sub-Class hierarchy
- Table per Concrete Class hierarchy