In our day to day development life, Inheritance plays an important role in our applications. As we know the advantages of inheritance in OOPS and it is also recommended to build the interface based programming with respect to improve the re-usability.
When developing the hibernate applications, it may have multiple pojo classes. And the pojo classes may have similar properties .
Hibernate supports three inheritance mapping strategies,
Table per class Hierarchy
Here single table is required to map the whole hierarchy, an extra column (known as discriminator column) is added to identify the class.
Table per subclass
In this strategy, tables are created as per class but related by foreign key.
Table per concrete class
Using union-subclass element
Using implicit polymorphism
In this strategy tables are created as per class.
Have a great Session. Happy Learning !
Next Session Link : • Hibernate | Session 4| Aether