-->
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: Using Oracle10g and Sequences
PostPosted: Tue May 13, 2008 3:45 pm 
Newbie

Joined: Sat May 03, 2008 3:35 pm
Posts: 6
hi forum,

i have a question about the right annotaion for using a sequence
as a generator for an id.

@Id
@Column(name = "ID", nullable = false, unique=true)
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="HIB_SEQ")
@SequenceGenerator(name="HIB_SEQ",sequenceName="USERS_SEQ")

this is my implementation, the sequences name in db is USER_SEQ
the problem is that hibernate uses a own sequencegenerator and the
returning id for an insert is wrong.

is the usage of @SequenceGenerator the right way for using Oracle Sequences?

thx for any hints!


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 13, 2008 4:30 pm 
Red Hat Associate
Red Hat Associate

Joined: Mon Aug 16, 2004 11:14 am
Posts: 253
Location: Raleigh, NC
Use allocationSize=1

http://opensource.atlassian.com/project ... se/ANN-354

_________________
Chris Bredesen
Senior Software Maintenance Engineer, JBoss


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.