-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Update whole object and graph
PostPosted: Mon Sep 07, 2009 6:41 am 
Newbie

Joined: Wed Aug 05, 2009 9:52 am
Posts: 4
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.