-->
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.  [ 1 post ] 
Author Message
 Post subject: Problem with sequence generation in Oracle
PostPosted: Thu Jul 02, 2009 8:14 am 
Newbie

Joined: Thu Jul 02, 2009 8:03 am
Posts: 2
I am Newbie to Hibernate.I have a table with primary key as autogenerate column.
I have given my mapping hbm file below

<hibernate-mapping>
<class name="sample.test" table="TEST" >
<id name="id" column="id" type="long" >
<generator class="sequence" >
<param name="sequence" >seq_test</param>
</generator>
</id>
....
.....

</hibernate-mapping>


My class contains:-

private long id;

public long getId()
{
return id;
}

public void setId(long id)
{
this.id = id;
}

However, this doesn't work properly for an oracle database unless you add allocationSize=1 to @SequenceGenerator. Does anyone how to do this? I can't find any documentation, which defines how to add another parameter for allocationSize (<param name="?">1</param>) in <hibernate-mapping>?

Can anyone please tell me the use of "allocationSize". I can't find any documentation for this.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.