-->
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: Copy into another db with generated values
PostPosted: Mon Jun 04, 2007 10:15 am 
Newbie

Joined: Mon Jun 04, 2007 9:47 am
Posts: 4
Hello,
I'm looking for a simple way to copy an object from a session connected to a database A into another database B (same application, same db version, same object model) to deploy easily a "disconnected" server on a notebook.
So a session connected on "A" is opened, selected objects are read and detached.
These objects are then "saved" into another session connected on "B".

At the moment, this prototype does not suit our needs because object ID and version field are re-generated by session "B".

Is there a way to keep ID and version when doing such a copy ? Thank you in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 04, 2007 12:55 pm 
Newbie

Joined: Mon Jun 04, 2007 12:27 pm
Posts: 2
Hello,

you might want to use replicate() method. Take a look at Hibernate reference docs, namely chapter "10.9. Replicating object between two different datastores"

http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#objectstate-replicating


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.