-->
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: GenericGenerator
PostPosted: Wed Jan 25, 2006 1:21 pm 
Beginner
Beginner

Joined: Fri Jan 16, 2004 11:05 am
Posts: 33
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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 25, 2006 6:17 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Works for me you'll need to provide a runnable test case

_________________
Emmanuel


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.