-->
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: many to many relation
PostPosted: Sat Jul 10, 2010 7:32 am 
Newbie

Joined: Tue Jul 06, 2010 11:37 am
Posts: 6
many-to-many relation:
----------------------

i have table A, table B , link table or reference table C

Table A Table C Table B
AId AId BId
AName BId BName

as table c is link table it contains the two foreign keys(AId,BId)........

as this relation is many-to-many the mapping file for TableA ie A.hbm.xml is

<class name="A" table="A"....>
<set name="bset" table="C">
<key column="AId"/>
<many-to-many column="BId" class="B"/>
</set>
</class>

as this is the way to do for many to many relation............

my silly doubt is if i write a set using one-to-many association in A.hbm.xml to C(AId) and set using one-to-many association in B.hbm.xml to C(BId)..............i can run this hbm's in hibernate,running good and fetching me exact results.

can i say that one-to-many from one side and one-to-many from other side ====== many-to-many relation? is this correct???

please reply with your suggestions........

Thanks,
M.Rakesh


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.