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: Partial loading of a big collection
PostPosted: Wed Sep 02, 2009 1:08 pm 
Newbie

Joined: Wed Sep 02, 2009 11:53 am
Posts: 5
Hi all

I have a one-to-many relation between the entities (say, Order and OrderDetails) and there can be many (possibly hundred thousand) OrderDetails per Order. Therefore it is impossible to load the complete collection into memory, rather I have to load them via where clauses, to just load those portions of the OrderDetails table which I need.

Currently I am trying to implement it in this manner:
- lazy-loading = "true"
- cascade = "none"
- do not use the collection property on the Order class (this would trigger a lazy load)
- instead, load the collection partially with session.CreateCriterion

Am I missing a better approach for this scenario? Is there something like a recommended pattern?

Perhaps a better approach would be something like

Code:
<class name="Order">
<set name="OrderDetails" where="MY_WHERE_CLAUSE">
...
</set>
</class>


and then adapt MY_WHERE_CLAUSE dynamically, but I don't think this is possible.

Thank you for any hints!

Jonas


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.