I get the error below when trying to define a GenericGenerator in package-info. I have the Type deifned there and that works. If I define the GernericGenerator at the class level it works.
Bug or feature?
By the way, this very useful. Thanks much.
Hibernate version:
3.1.1
Annotations 3.1Beta8
Mapping documents:
@GenericGenerator( name = "UnqeKeyGen"
, strategy = "util.hibernate.type.UnqeKeyGenerator"
, parameters = { @Parameter( name="key_group", value = "UnqeKeyGrp" ) }
)
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Exception in thread "main" org.hibernate.AnnotationException: Unknown Id.generator: UnqeKeyGen
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:996)
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.createEntityManagerFactory(Ejb3Configuration.java:402)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:117)
at test.junit.TestCase.setUp(TestCase.java:75)
at test.junit.common.TestCommon.main(TestCommon.java:79)
Name and version of the database you are using:
IBM DB2 8.2
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
11:18:05,057 DEBUG AnnotationBinder:862 - Processing dao.common.PersonDao per property annotation
11:18:05,057 DEBUG AnnotationBinder:862 - Processing dao.common.PersonDao per property annotation
11:18:05,104 DEBUG AnnotationBinder:931 - Processing annotations of dao.common.PersonDao.unqeKey
11:18:05,104 DEBUG Ejb3Column:160 - Binding column UNQE_KEY unique true
11:18:05,104 DEBUG AnnotationBinder:1044 - unqeKey is an id
11:18:05,104 DEBUG SimpleValueBinder:186 - building SimpleValue for unqeKey
|