• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Best inheritance mapping strategy..

 
Udara Amarasinghe
Ranch Hand
Posts: 109
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,

We know that there is there are 3 inheritance mapping strategies in java persistence.

* SINGLE TABLE PER CLASS HIERARCHY
* JOIN SUB CLASS HIERARCHY
* TABLE PER CONCRETE ENTITY CLASS

And I know that SINGLE TABLE PER CLASS HIERARCHY and JOIN SUB CLASS HIERARCHY are better than TABLE PER CONCRETE ENTITY CLASS because support for polymorphic relationships are very poor with TABLE PER CONCRETE ENTITY CLASS strategy.

So my question is what is the best strategy from both SINGLE TABLE PER CLASS HIERARCHY and JOIN SUB CLASS HIERARCHY with minimum draw backs.
 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In general I would recommend SINGLE_TABLE, as it is normally to simplest and most efficient.

But it depends on your data, if the hierarchy has little data in common, the using JOINED or even TABLE_PER_CLASS may be desirable.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic