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