-->
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.  [ 4 posts ] 
Author Message
 Post subject: How to achive lazy loding with criteria
PostPosted: Mon Mar 03, 2008 5:48 am 
Newbie

Joined: Fri Feb 29, 2008 2:22 am
Posts: 5
Hi,

I need to lazyly load the entities to the parent object with some filter condition.

I am having User and Role objects. In the role table, i have status field. when i call getAllRoles() method on User object, i should get only status='active' roles.

But right now i am getting all the roles, irrespective of the status of the roles.

is there any way to configure it in mapping level?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 03, 2008 10:30 am 
Senior
Senior

Joined: Fri Jun 01, 2007 12:41 pm
Posts: 121
Did you try the collection filtering?

http://www.hibernate.org/hib_docs/reference/en/html/objectstate.html#objectstate-filtering


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 05, 2008 1:42 pm 
Expert
Expert

Joined: Sat Jan 17, 2004 2:57 pm
Posts: 329
Location: In the basement in my underwear
Show your mapping for the filtering.

Also, are you enabling the filter?

_________________
Some people are like Slinkies - not really good for anything, but you still can't help but smile when you see one tumble down the stairs.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 05, 2008 1:43 pm 
Expert
Expert

Joined: Sat Jan 17, 2004 2:57 pm
Posts: 329
Location: In the basement in my underwear
stupid double post

_________________
Some people are like Slinkies - not really good for anything, but you still can't help but smile when you see one tumble down the stairs.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.