-->
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.  [ 1 post ] 
Author Message
 Post subject: Mapping subclasses
PostPosted: Tue Mar 15, 2011 2:29 pm 
Newbie

Joined: Wed Jun 17, 2009 5:15 pm
Posts: 2
I have class Data, which contains my data, and class DataArchive that merely extends Data and contains nothing new. The only other change in DataArchive is an xdoclet marking mapping it to table DATA_ARCHIVE rather than DATA. My generated hbm.xml files end up being exactly the same except for the class name and table mapping name. However, when I try to do a Criteria search on Data.class with setMaxResults(5), it ends up giving me 5 results from the DATA table and 5 results from the DATA_ARCHIVE table (totally unexpected!). What I really want is to get the records from the DATA table first, and then if the limit is not reached, get the additional records from the DATA_ARCHIVE table. Is there a good way to do this? I'm somewhat wary of joins and unions because both tables will end up containing millions of records.


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

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.