Hibernate

adplus-dvertising
Table Per Subclasses
Previous Home Next

In this approach one table for each class of the faimily is created. Table for the parent class contains field to represenent parent class data member and table for the subclasses contains fields to represent their own data member. Primary key of parent table is used for hierarchy in table for subclasses.

Advantages

  • Tables are normalized
  • Not null constraint can be applied

Disadvantages

  • performance is degraded becouse to insert and fetched subclsses object. Multiple queries or joins are required
  • Tables are not fully normalized.
Previous Home Next