-->
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: SQLServer, Oracle and seqhilo usage
PostPosted: Sun May 04, 2008 3:19 am 
Newbie

Joined: Sun May 04, 2008 3:04 am
Posts: 1
My Application uses as underline database Oracle or SQLServer depending on our customer demand.

In Oracle I use SEQUENCE for ID generation and for SQLServer I use IDENTITY.
In order to support this I am using the GenerationType.AUTO , however, when doing so when working with Oracle the seqhilo does not work (it does work only when using GenerationType.SEQUENCE). I even tried to add 'allocationSize' but it did not help.

Code:
@Id
@GeneratedValue(strategy=GenerationType.AUTO, generator="XX")
@SequenceGenerator(name="XX", sequenceName="SEQ_AS_TEST", allocationSize=20 /* works only if generation type is sequence*/)
@Column(name = "ID", unique = true, nullable = false)
public int getId() {
   return this.id;
}


- Does the seqhilo works only with GenerationType.SEQUENCE ?
- Is there any way to force seqhilo usage with GenerationType.AUTO?

I am using:
- Hibernate, Hibernate EntityManager, Annotations - 3.2.5.
- Oracle 10
- SQLServer 2005

Thanks,
Ronen


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.