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: ManyToMany with extra field in mapping table
PostPosted: Tue Sep 29, 2009 10:37 am 
Newbie

Joined: Tue Sep 08, 2009 6:58 am
Posts: 1
Hi,
I need to use a many-to-many relation between two class, eg., A and B.
So A has an IList<B> and B has an IList<A>. Moreover, this many-to-many relation is "provided" by a link table, that store, for each record, idA and idB. I create the mapping of A and B and all works.

Now I want to add a property on the link table, because I need a property on the association between A and B.

Which is the best practise in this case?

Have I to map the link table like an entity, or it is enough to store, both in A and B entity, also a list of <idOtherEntity,propertyOnTheLinkTable>? If the second option is right, how could I implement it in the mapping file?

Thank you very much


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.