-->
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: Problem with many-to-many mapping.
PostPosted: Tue Mar 06, 2007 7:46 am 
Newbie

Joined: Tue Mar 06, 2007 7:28 am
Posts: 2
Hi all,
I am trying to insert in to multiple tables using many-to-many mappings..
I have a senario where i have to store primary keys of two tables(Table1 and Table2) in to another table(Relation), for which i am using many-to-one mapping..
in my table1.hbm.xml, i am specifying

Code:
<set name="relation" table="Relation">
           <key column="table1_fk"/>
           <many-to-many column="table2_fk" class="Table2POJO"/>
</set>



I am trying to insert in to Relation table using this. In my Relation table, i am having a primary key relation_id. As i am not having any hbm.xml file and Pojo class for Relation, i can't generate the id for Relation table and I am getting error for the same when i am trying to insert using the obove mapping.

how can i achieve this situation. Is there any other way to do this? Please help me in this regard


Regards
Manjunath


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.