-->
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.  [ 3 posts ] 
Author Message
 Post subject: Intializing sequences
PostPosted: Thu Jun 09, 2005 1:26 pm 
Newbie

Joined: Tue Apr 12, 2005 6:00 pm
Posts: 4
I'd like to use a sequence generator with oracle. Problem is that I insert some data with DBUnit in order to pre-populate the database. These inserts don't use the sequences. So, I'd like to be able to tell Hibernate to use a sequence that starts at a certain number, e.g., 50.

Any way to do this?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 1:46 pm 
Regular
Regular

Joined: Sun Aug 01, 2004 6:49 pm
Posts: 76
Do this in your database setup script/schema:

Code:
ALTER SEQUENCE "SEQUENCE_NAME" INCREMENT BY 5;



I think there is no property for this, the only I know is:

Code:
<generator class="native">
    <param name="sequence">SEQUENCE_NAME</param>
</generator>


HTH
Thomas


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 10, 2005 1:08 pm 
Newbie

Joined: Thu Nov 18, 2004 6:51 pm
Posts: 10
Location: Arizona
Try this:

Code:
<generator class="native">
    <param name="sequence">SEQUENCE_NAME</param>
    <param name="parameters">INCREMENT BY 5</param>
</generator>


Look at the javadoc for SequenceGenerator.PARAMETERS:

Quote:
The parameters parameter, appended to the create sequence DDL.


Hope that helps,

John


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.