-->
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.  [ 1 post ] 
Author Message
 Post subject: Save with provided id
PostPosted: Thu Oct 18, 2012 5:50 pm 
Newbie

Joined: Thu Oct 18, 2012 5:13 pm
Posts: 1
Hi all,

I am working on a project with Hibernate 3.5.6, in which we have two kinds of insert:
1. dump some legacy data into mySQL with object id.
2. insert data with auto-generated id.

The deprecated save(Object object, Serializable id) allows me to achieve exactly what I want, but it is deprecated. I have tried to use 'native', 'increment' for generator, but they only work for auto generated id. Removing the generator would allow the insertion with id to work, but the other ding of insert would fail.

Please give me some suggestion on how I can work around this, thank you.


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

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.