I have a problem with the ID sequence generators (Oracle database).
I use Hibernate 3.1.
The Id column is so decrared:
Code:
@Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "RNSEQUENZ")
public String getRN() {
return RN;
}
public void setRN(String RN) {
this.RN = RN;
}
I have the sequence with this name, the SQL: "select RNSEQUENZ.nextval from dual" returns the next value of sequence.
But my application throws an exception:
Code:
Exception in thread "main" javax.persistence.PersistenceException: org.hibernate.AnnotationException: Unknown Id.generator: RNSEQUENZ
at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:173)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:103)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
at konto.ejb3.TestKontoEJB3.main(TestKontoEJB3.java:29)
Caused by: org.hibernate.AnnotationException: Unknown Id.generator: RNSEQUENZ
at org.hibernate.cfg.AnnotationBinder.bindId(AnnotationBinder.java:1595)
at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1065)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:629)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:276)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:210)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:997)
at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:722)
at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:161)
at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:567)
at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:118)
at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:165)