-->
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: Mapping two levels of to-many relationships?
PostPosted: Tue Oct 28, 2003 5:48 pm 
Newbie

Joined: Wed Oct 15, 2003 11:16 am
Posts: 6
I have a model where three tables are related two levels of two-many relationships.

member <to-many> recipient <to-many> event

These are garden variety to-many relationships based on a foreign key of the parent in the child, and I have a working mapping of this in hibernate.

Member.getRecipients():Set
Recipient.getEvents():Set

Does hibernate provide a facility to map a lazy collection of Events directly into the Member?

I can obviously provide a cover method in Member to iterate the recipients, and collect the list of events to return. I can also use HQL or SQL, but I'm interested in knowing whether there's a suitable way of doing this purely in the mapping.

- Ken


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 28, 2003 5:55 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Actually there is a way, if you are prepared to use composite keys in your relational model. I do not recommend this as a good practice, however.


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.