-->
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.  [ 2 posts ] 
Author Message
 Post subject: Save new copy of existing entity
PostPosted: Tue Aug 15, 2006 11:05 am 
Newbie

Joined: Tue Mar 21, 2006 4:19 am
Posts: 15
Hi guys! I have an existing entity in the hibernate session but i want to make a modification to its assiociation list and save it in new record - new insert. I tried to set the id to null but hibernate throws me an exception. Any suggestions?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 15, 2006 6:33 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Detach it, then clear the id, then save it. Or make a new object and copy the values.

_________________
Code tags are your friend. Know them and use them.


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

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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.