-->
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: GenerationType.AUTO for SQL Server and Oracle DB
PostPosted: Thu Jul 31, 2014 10:48 am 
Newbie

Joined: Thu Jul 31, 2014 10:33 am
Posts: 1
I'm looking for a proper GenerationType that will work both on SQL Server and Oracle DB.

My table has a simple int ID, which has a IDENTITY behaviour in SQL Server. I would like Hibernate to leverage that IDENTITY when SQL Server is used.

I also need Hibernate to use Table or Sequence strategy if Oracle DB is used.

I thought that the correct type to use would be GenerationType.AUTO. However, if I use that type with SQL Server, Hibernate tries to query a sequence table in order to obtain the next ID.

If I use the IDENTITY type, Hibernate lets SQL Server use the column auto-increment behaviour, but IDENTITY is not supported by Oracle.


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.