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