-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: table per heirarchy
PostPosted: Sat Sep 24, 2005 8:54 am 
Newbie

Joined: Tue Jun 21, 2005 1:03 am
Posts: 5
In table-per-hierarchy approach we can have single table in DB as well as single hibernate mapping file containing mapping for each sub-class. Here we need discriminator to differentiate between different sub-classes and while loading or in HQL query we can use Base class.(In this case discriminator is must)

The same can be achieved by having separate mapping file per sub class, pointing to common table. (Considering each subclass has less common properties. and no subclass properties are sub set of properties of other sub class). But in this scenario while loading and in HQL queries we have to pass sub-class name, base class cannot be used for this purpose. In this approach we don’t need discriminator column in DB.

So which approach is better in terms of design and performance?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 27, 2005 10:23 am 
Newbie

Joined: Tue Jun 21, 2005 1:03 am
Posts: 5
any views? any suggestions ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.