Skip to content

Inheritance patterns: Table Per Concrete Class Inheritance

G4br13l3 edited this page Sep 3, 2015 · 18 revisions

Table Per Concrete Class Inheritance

In Table Per Concrete Class strategy a table is defined for each concrete class in the inheritance hierarchy to store all the attributes of that class and all of its superclasses. This strategy is optional in several ORM technologies (e.g. JPA), and querying root or branch classes can be very difficult and inefficient.

Example

Now suppose you want to map the whole hierarchy given below on the left into a coherent database schema. The table structure for this hierarchy is that shown on the right.