Hi,
I have a parent table say Table A and i have 3 children to it Table B,C,D
I set all the relationships with Table B,C,D to inverse = true in one-to-many mappings Table A. and have many to one mappings in the child tables (B,C,D)
The child tables B,C,D are only consisting of composite keys with same layout:
Code:
<class
name="ClassB"
table="B">
<composite-id>
<key-property
name="id"
column="ID"
type="long"
/>
<key-property
name="col1"
type="long"
column="COL1"
/>
<key-many-to-one
name="col2"
column="COL2"
class="TableA"
foreign-key="FK1"
/>
</composite-id>
</class>
same goes for table C, D ....
And in the code i have set all the relationships and everything.. so when i try to update the existing record ... It always inserts a new record. I want to update the existing one..
In the code when i try to update it ... I get the list from the parent.... I clear the list and populate another list with values that come from the UI...add the list for updating... and set it to the parent.. instead of manually going thru the list to update each value... that would be cumbersome... Is there any alternative to it...
Has anyone encountered any similar behaviour.... Kindly let me know
Thanks in advance...