-->
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: Overriding Generated Ids in Import / Export
PostPosted: Tue Nov 28, 2006 8:28 pm 
Newbie

Joined: Wed Aug 30, 2006 4:05 am
Posts: 3
We're writing some import / export code in Hibernate 2. We've written out the entities as XML with the primary key ids in the XML as well.

Is it possible to import (I guess insert) and preserve the original ID fields? Is there a keys table that I would also need to update?

I guess if I can suppress generation of IDs by Hibernate for a period of time, then that'd do the trick.

Sorry if this has been asked before, but I can't find it anywhere in the forums.

Cheers,

Mark C

PS Our ids are being generated with a HiLo algorithm if that makes a difference.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 29, 2006 1:27 am 
Regular
Regular

Joined: Tue May 16, 2006 3:32 am
Posts: 117
You could have a look at this and see if this helps:

http://www.hibernate.org/hib_docs/v3/re ... eplicating

You could also set the id generator as assigned and then insert, if changing the mappings is an option.


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.