-->
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: Help required on creating the mapping for a table
PostPosted: Wed Nov 14, 2007 9:24 am 
Newbie

Joined: Wed Nov 14, 2007 9:15 am
Posts: 2
Hello,

I have a special scenario where I have more than one Sequence generated key on my table.

My table in the oracle database has the following fields


CUST_AFFILIATION_ID
PRE_REGISTRATION_ID
LAST_UPDATE_TMSTMP
LAST_UPDATE_USER_ID


where CUST_AFFILIATION_ID is the primary key on the table, and a sequence generated key.

So in the hibernate mapping file, I use

<id name="CustomerAffiliationId" type="java.lang.Long" column="CUST_AFFILIATION_ID" unsaved-value="null">
<generator class="sequence">
<param name="sequence">CUST_AFFIL_SEQ</param>
</generator>
</id>

But the next column in the table"PRE_REGISTRATION_ID" is also a sequence generated value, but is not a primary or composite key. It is just a plain column in the table, but the valus is generated from the Sequence.


Can any one help me on how to write a hibernate mapping for this field?


Any immediate help would be very much appreciated.

_________________
kanumolu


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.