-->
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: Splitting up a many-to-many
PostPosted: Thu Oct 21, 2004 7:18 am 
Newbie

Joined: Thu Oct 21, 2004 7:02 am
Posts: 14
Hi
I want to split up a many-to-many assosiation, and I've got the impression that the recommended way to do this is like the mapping I've pasted under "Mapping documents". Anyone know of any complete examples doing it this way? I want do be able to use lazy loading, and it to be bidirectional. What I can't understand is this: How do I in this example map the Employee, so that I can fetch the Meetings he/she attends? Not only the entries in EmployeeMeeting. And to make this bidirectional, can I just do the same kind of mapping for Meeting, so that I can fetch all the Employees attending a meeting. Or is it a better way to make this bidirectional?

Hibernate version: 2.1.2

Mapping documents:
(taken from: http://adigio.com/blogs/christian/archives/2004/09/hibernate_manyt.html)

Employee:
<one-to-many
class="foo.bar.EmployeeMeeting"/>

Meeting:
<one-to-many
class="foo.bar.EmployeeMeeting"/>

EmployeeMeeting:
<many-to-one
class="foo.bar.Employee/>
<many-to-one
class="foo.bar.Meeting/>

Any ideas or hints?

Thanks,
Kristian


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.