-->
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: novel use case for id field
PostPosted: Mon May 05, 2014 3:50 pm 
Newbie

Joined: Mon May 05, 2014 3:39 pm
Posts: 2
Hi
I am using hibernate 3.6 and trying to do the following
I have an entity whose id field is either set by a sequence or is assigned by the user
Its set by the sequence in one scenario in one maven project and assigned in a data migration scenario which is in another maven project

Is it possible to do this via some id generation strategy in hibernate ?
<id name="matchId" type="long" unsaved-value="0" column="match_id">
<generator class="native">
<!--
ATTN: When copying data from one database to another, be sure to set
this field explicitly in one of them, so that IDs will not get out of
sync between the two.
-->
<param name="sequence">seq_matches_all</param>
</generator>
</id>
This always uses the sequence, but we want to use the assigned in another scenario.
Is it possible to do without having 2 mapping files ?


Top
 Profile  
 
 Post subject: Re: novel use case for id field
PostPosted: Tue May 06, 2014 4:29 pm 
Newbie

Joined: Mon May 05, 2014 3:39 pm
Posts: 2
does anybody have any ideas on how I can achieve this ?


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.