-->
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: AUTO GeneratedValue and specifying sequence name in Oracle
PostPosted: Mon Apr 04, 2011 1:49 am 
Senior
Senior

Joined: Sat Nov 27, 2004 4:13 am
Posts: 137
I need to have my application work both on Oralce and MySQL.

I annotated the id's entity as:
Code:
    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQUENCE")
    @SequenceGenerator(name = "SEQUENCE", allocationSize = 1, sequenceName = "my_sequence")


when everything goes fine when I use Oracle, but when I want to execute my application on MySQL I got an error that it does not know generator "SEQUENCE".

if I do this:
Code:
    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.AUTO)

is there anyway to specify sequence name on Oracle?

Thanks in forward

_________________
don't forget to credit!

Amir Pashazadeh
Payeshgaran MT
پايشگران مديريت طرح
http://www.payeshgaran.co
http://www.payeshgaran.org
http://www.payeshgaran.net


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.