-->
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: Multiple sequence columns
PostPosted: Wed Jan 21, 2004 12:10 pm 
Newbie

Joined: Tue Nov 04, 2003 4:20 pm
Posts: 13
Hi -
I have a column other than the primary key which gets populated by a sequence. How do I set up the mapping to do that. In brief,

Code:
<hibernate-mapping>
<class name="test.foo" table="Types">
<id column="ID" name="id" type="java.lang.Integer">
<generator class="sequence">
<param name="sequence">TYPES_SEQ</param>
</generator>
</id>

<property column="ALTERNATE_ID" type="java.lang.Integer" />
</class>
</hibernate-mapping>


Incase I have a sequence called Altermate_Seq, how do I use that for the column Alternate_Id

Thanks-


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 21, 2004 12:31 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
You can't, but you're not the first to ask. Check JIRA and if it's not in, add it as an improvement.
For now, get the sequence number using the underlying SQL connection.

_________________
Emmanuel


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.