Google News
logo
JPA - Interview Questions
Explain JPA Inheritance Strategies?
JPA specification provides several strategies :

* MappedSuperclass : Inheritance is implemented in the domain model only without reflecting it in the database schema. See MappedSuperclass.

* Single table : The domain model class hierarchy is materialized into a single table which contains entities belonging to different class types. See Single table.

* Joined table : The base class and all the subclasses have their own database tables and fetching a subclass entity requires a join with the parent table as well. See Joined table.

* Table per class : Each subclass has its own table containing both the subclass and the base class properties.
Advertisement