Hi,
I want to update a hibernate object and object graph. I have object and ralated objects which created by XML deserialization. Now I set id of the old object and try to save new object expecting that it will update existing object difference automatically by looking into existing id. But instead it is throwing exception that there is already a different object is associated with same id.
I expect if hibernate finds same id, it updates or else it create new id. right ? Then why here it is complaining that there is a different object associated with same id ?
I do not want to get existing object and set field one by one and the call save. Which I know works but it is a tedious job as I have hundreds of fields.
Is there a way, or am I using incorrectly ?
Thanks, Datta
|