Inheritance Mapping
Table Per Subclass using Annotation
As we have specified earlier, in case of table per subclass strategy, tables are created as per persistent classes but they are reated using primary…
Table Per Subclass
In case of Table Per Subclass, subclass mapped tables are related to parent class mapped table by primary key and foreign key relationship. The <joined-subclass>…
Table Per Concrete class using Annotation
In case of Table Per Concrete class, tables are created per class. So there are no nullable values in the table. Disadvantage of this approach…
Table Per Concrete
In case of Table Per Concrete class, there will be three tables in the database having no relations to each other. There are two ways…
Table Per Hierarchy using Annotation
In the previous page, we have mapped the inheritance hierarchy with one table only using xml file. Here, we are going to perform this task…
Table Per Hierarchy
By this inheritance strategy, we can map the whole hierarchy by single table only. Here, an extra column (also known as discriminator column) is created…
Inheritance Mapping
We can map the inheritance hierarchy classes with the table of the database. There are three inheritance mapping strategies defined in the hibernate: Table Per…