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
|