Table Per Hierarchy
- Table Per Hierarchy - Using this strategy, We can map the whole hierarchy by single table only. For this one extra column is created in the table to identify the class.(known as discriminator column).
Now Mapping file will be:
Note: In case of table per class hierarchy a discriminator column is added by the hibernate framework that specifies the type of the record.
Now table will look like this: