Hibernate and Child Objects (add versus clear)
- by tyndall
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.