-->
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: hibernate3 collection filter
PostPosted: Mon Aug 08, 2005 9:20 pm 
Beginner
Beginner

Joined: Tue Apr 12, 2005 9:15 pm
Posts: 24
I have a class Employees that has a collection of class Address, and also a collection of class Groups. When I query for Employees, since I can outer join fetch only one collection, I fetch the collection of Address. Once I get the list of Employees, I want to lazy initialize the collection Groups - but for this collection, I want to apply a filter "myFilter" (the filter is to get only selected group lazy initialized). If I do enableFilter("myFilter") and set the proper parameter, then do employees.getGroups(), it initializes all groups. In my mapping, I have the filter applied both for the collection Groups and the Group class. My question is - is it possible to get a filtered collection while doing lazy initialization? If yes/no how else can I get a filtered collection for the list of Employees I get?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 08, 2005 9:35 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
yes it is absolutely possible; you did something wrong


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 08, 2005 9:35 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
btw, you can outer join fetch any number of collections in HB3


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 09, 2005 7:31 am 
Beginner
Beginner

Joined: Tue Apr 12, 2005 9:15 pm
Posts: 24
Thanks Gavin. I didn't knew I can fetch more than one collection. Also, this was my first attempt using filter - so, followed the steps, must have done something wrong. I will attempt to make the filter work also.


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.