-->
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: Howto dublicate entity
PostPosted: Wed Jan 23, 2008 4:48 pm 
Newbie

Joined: Wed Jan 23, 2008 4:43 pm
Posts: 1
Hi,

what is correct way to duplicate the object tree?


Top
 Profile  
 
 Post subject: Re: Howto dublicate entity
PostPosted: Wed Jan 23, 2008 6:27 pm 
Expert
Expert

Joined: Thu Jul 05, 2007 9:38 am
Posts: 287
dtravin wrote:
Hi,

what is correct way to duplicate the object tree?


Where do you want to duplicate the object tree? If you want it twice in memory, you could just load it with two different sessions.

Or if you want it twice in the database you could
- detach the object (close the session)
- set the id to NULL
- persist the object tree again.

It should now considered a new object by hibernate and get a new ID (assuming it is configured this way)

_________________
Please rate useful posts.


Schauderhaft: Softwaredevelopment, Projectmanagement, Qualitymanagement and all things "schauderhaft"


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.