-->
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: Auto Collection Filter on Lazy Initialization
PostPosted: Thu Jan 13, 2005 6:36 pm 
Newbie

Joined: Thu Jan 13, 2005 6:24 pm
Posts: 12
I'm using hibernate 2.1. Say I have three tables:

Person (identifier, name)
Group (identifier, groupname)
GroupMemebership ( person_id, group_id, year)


What I am trying to say is that A person was in a particular group for only a specified year. For example a person might be in an "Undergraduate Student" group in 2004 and a "Graduate Student" in 2005. But both relationships are kept so we can look up what group a person was in for a particular year.

What I want to be able to do is query for a Person object specifying a year, and have it return a person object with it's GroupMembership collection already having a filtered subset based on the year.

Is this possible? I know I can do a filter to get a subset but I'd like to be able to pass a person object with a lazy GroupMembership collection to a View layer and have it load the subset of the GroupMembership collection if the view layer needs it.


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.