-->
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: Mapping oracle sequence to id field
PostPosted: Tue Feb 15, 2005 2:40 am 
Newbie

Joined: Mon Feb 14, 2005 12:14 am
Posts: 14
Location: Boston, USA
Hibernate version:2.1.7

Name and version of the database you are using:Oracle 9i

Hi,
I have a sequence created in the database for my primary key. How can i use that sequence to assign the value for id.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 15, 2005 3:47 am 
Newbie

Joined: Wed Sep 01, 2004 9:04 am
Posts: 18
Location: Enschede, Netherlands
<id name="id" type="long" column="uid">
<generator class="sequence">
<param name="sequence">uid_sequence</param>
</generator>
</id>

See also section 5.1.4.4 of the Hibernate reference:
http://www.hibernate.org/hib_docs/reference/en/html/mapping.html#mapping-declaration-id-sequences


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.