-->
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: Non ID Sequence Values
PostPosted: Thu Feb 26, 2004 4:01 pm 
Newbie

Joined: Thu Feb 26, 2004 3:51 pm
Posts: 1
I've done some searching and read the mapping DTD but haven't found a way to generate a property value from a sequence without making it the ID for the class.

<class name="MyClass" table="MyTable">
<id name="oid" type="long" unsaved-value="null">
<column name="oid" sql-type="number(38)" not-null="true"/>
<generator class="native">
<param name="sequence">oidseq</param>
</generator>
</id>
<property name="anotherId"/>
</class>

MyClass has a property called 'oid' as its primary key and the sequence generation works fine. How do I tell Hibernate to generate the value for anotherId (a non primary key property) from a database sequence?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 26, 2004 7:01 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Not possible.


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.