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: ID generation stategy
PostPosted: Fri Sep 14, 2007 6:29 am 
Newbie

Joined: Fri Sep 14, 2007 6:26 am
Posts: 1
Hi,

I'm developing a project where frequently i need to import existing data from xml files and where all the attributes of the instances, including the id, are already set. To cope with that, i'm using the "assigned" id generation strategy of hibernate. The problem is that i will need to create new instances, and for that i would like hibernate to generate the ids, according to the native strategy. Is there a way to use the combination of this two strategies, to generate the id only when the field is empty or not set? Has anyone did something similar? If it's not possible how can i create my own id generator to resolve this issue?

Thanks in advance for the reply!
MAD


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.