-->
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.  [ 3 posts ] 
Author Message
 Post subject: Copy from one database to another
PostPosted: Wed Nov 02, 2005 1:40 pm 
Newbie

Joined: Tue Jul 12, 2005 1:17 pm
Posts: 7
I'm trying to copy a graph of hibernate objects from one database (PostgreSQL) to another (Oracle). Is there a recipe for doing this easily? I tried using merge() on each object while traversing the relationships but then the child objects keys don't match up. Do I basically have to do this by hand or is there an easy way?

Sam


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 02, 2005 1:44 pm 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
in H3, session.Replicate should override any id generators

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 02, 2005 3:14 pm 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
ofcourse, you always have the problem as noted here by Gavin. stupid databases.

http://forum.hibernate.org/viewtopic.ph ... 054ad380f0

you'd be better of nulling out all the id values of the children and just re-saving them in the new database allowing it to regenerate the values.

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.