-->
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: How to add criteria to lazy loading
PostPosted: Mon Jan 02, 2006 9:02 pm 
Newbie

Joined: Wed Oct 12, 2005 10:28 pm
Posts: 10
NHibernate 1.0
-----------------

Hi, i have one scenario where i need to filter collection from lazy loading using icriateria, actually this can be done from hbm.xml configuration where in collection mapping i add where statement

<bag name="Products" where="quantity>10" ..>

but how to achived the same result using Criteria


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 04, 2006 12:41 pm 
Regular
Regular

Joined: Tue Mar 15, 2005 12:38 pm
Posts: 73
Location: Bucharest
Not possible as far as i know... but the collection can be set as lazy and you can use session.filter to get only products conforming a specified condition.

Or, maybe, I haven't tried that before, if the condition is allways the same (weight>500), you can map a second time the collection of products with the specified where attribute. Just a thought...


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.