Hibernate and Child Objects (add versus clear)
Posted
by tyndall
on Stack Overflow
See other posts from Stack Overflow
or by tyndall
Published on 2010-06-17T20:53:02Z
Indexed on
2010/06/18
0:33 UTC
Read the original article
Hit count: 216
Lets say I have domain model with Automobile and Wheels. Wheels is a List of Wheels Wheels has a many-to-one relationship to Automobile.
If I get an object back from Hibernate and it has 4 wheels. I take that object remove the 4 wheels and add 4. And then Save.
If I ask Hibernate for the object again and it returns an auto with 8 wheels... what are we doing wrong? I don't have access to the source for a few days but want to give our Java devs a push in the right direction. Thanks.
© Stack Overflow or respective owner