-->
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.  [ 2 posts ] 
Author Message
 Post subject: native sequences on oracle (Dialect does not support?)
PostPosted: Wed Aug 12, 2009 2:24 pm 
Newbie

Joined: Wed Aug 12, 2009 1:46 pm
Posts: 7
I have an annotated POJO where I want to have the database generate IDs via a native sequence.
When I try to run this class, hibernate complains that the dialect does not support sequences.
Any idea where I am going wrong?

I am using: org.hibernate.dialect.Oracle10gDialect against oracle 11g (there is no 11g dialect in hibernate 3)

Code:
@Entity
@javax.persistence.SequenceGenerator( name="SEQ_GEN", sequenceName="my_sequence")
public class BatchTask {
   private Long m_batchID;
   
   @Id
   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_GEN")
   public Long getBatchID() {
      return m_batchID;
   }
}


Here is the exception I get when trying to starup hibernate:
Caused by: org.hibernate.MappingException: Dialect does not support sequences
at org.hibernate.dialect.Dialect.getSequenceNextValString(Dialect.java:619)
at org.hibernate.id.SequenceGenerator.configure(SequenceGenerator.java:88)
at org.hibernate.id.SequenceHiLoGenerator.configure(SequenceHiLoGenerator.java:66)
at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:127)
... 46 more


Top
 Profile  
 
 Post subject: Re: native sequences on oracle (Dialect does not support?)
PostPosted: Wed Aug 12, 2009 2:28 pm 
Newbie

Joined: Wed Aug 12, 2009 1:46 pm
Posts: 7
Never mind I had the wrong dialect.


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