Hi,
I tried to use a custom IdentifierGenerator for entity Id generation on Seam2.1.1.GA on JBoss5.0.1GA.(uses Hibernate 3.3.1.GA as default?)
Unfortunately I cannot apply the Generator using the @GenericGenerator annotation.
Code:
@javax.persistence.Entity
@org.hibernate.annotations.GenericGenerator(
name="test",
strategy="com.websein.wcrm.entity.util.MySQLKeyGenerator")
public class TestDing2 {
@javax.persistence.Id
@javax.persistence.GeneratedValue(generator="test")
private Long id;
public Long getId() {return id;}
public void setId(Long id) {this.id = id;}
}
Applying it this way produces the following stacktrace.
Code:
org.hibernate.AnnotationException: Unknown Id.generator: test
at org.hibernate.cfg.BinderHelper.makeIdGenerator(BinderHelper.java:428)
at org.hibernate.cfg.AnnotationBinder.bindId(AnnotationBinder.java:1901)
at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1279)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:754)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:546)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:291)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1148)
...
Debugging leads me to the assumption that this annotation simply is not present on my Class at Runtime.
Im working on this Problem for about 2 days and now I have absolutely no more ideas how to solve it. Only thing that works is defining all entites using XML hibernate mapping files. :-(
So did I miss some configuration detail to get this annotation working ?
Any help is appreciated. Ben J.