-->
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.  [ 4 posts ] 
Author Message
 Post subject: Sequence Parameter in hbm config file?
PostPosted: Fri Aug 05, 2005 2:27 pm 
Newbie

Joined: Fri Aug 05, 2005 2:07 pm
Posts: 3
Hi,

I can't get the syntax right for the parameter for an oracle style create sequence. I have:

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

where would I change this to include:
INCREMENT BY 1 START WITH 1 MAXVALUE 100 NOCACHE

Thanks,
Phil Hersh


Top
 Profile  
 
 Post subject: How about this
PostPosted: Fri Aug 05, 2005 3:32 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Could this be any help?
http://www.hibernate.org/296.html


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 05, 2005 5:45 pm 
Newbie

Joined: Fri Aug 05, 2005 2:07 pm
Posts: 3
Hi,

Thanks kgignatyev, but no. I'm using the hbm2ddl.SchemaExportTask which reads the hbm files and generates the tables, indexes and sequences directly into my database.

I'd like to embed the parameters directly into the hbm file so the newly generated sequences start with a value higher than the test data I have inserted using dbunit.

If I can add a parameter to the hbm files to start the sequences with higher key id values than those already used in my test data, I won't need to change the sequences via Oracle stored procedure or java code (or ugh manually) eliminating a step from my build and test cycle.

Thanks,
Phil


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 23, 2005 1:10 pm 
Newbie

Joined: Fri Aug 05, 2005 2:07 pm
Posts: 3
Code:
<id type="long">
      <generator class="native">
          <param name="sequence">cust_id_seq</param>
      <param name="parameters">START WITH 10</param>
      </generator>
    </id>


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