Hibernate Table Per Hierarchy using Annotation
In the past page, we have mapped the legacy chain of importance with one table utilizing xml record. Here, we will play out this undertaking utilizing comment. You have to utilize @Inheritance(strategy=InheritanceType.SINGLE_TABLE), @DiscriminatorColumn and @DiscriminatorValue explanations for mapping table per pecking order methodology.
In instance of table per chain of importance, just a single table is required to delineate legacy progressive system. Here, an additional section (otherwise called discriminator column) is made in the table to recognize the class.
Let's see the legacy hierarchy:
There are three classes in this progression. Representative is the super class for Regular_Employee and Contract_Employee classes.