I have this annotated entity code that's working in 4.2.0.Final but not in 4.3.0.CR2.
@Entity
@Table(name = "party_category_tax", schema = "ichibanmae_invo")
public class PartyTaxCategory implements java.io.Serializable {
private static final long serialVersionUID = -5119203949164267871L;
private PartyCategory partyCategory;
private String partyCategoryId;
@Id
@GeneratedValue(generator = "customSharedIdGenerator")
@GenericGenerator(name = "customSharedIdGenerator", strategy = "foreign", parameters = @Parameter(name = "property", value = "partyCategory"))
@Column(name = "party_category_id", unique = true, nullable = false, length = 40)
public String getPartyCategoryId() {
return partyCategoryId;
}
public void setPartyCategoryId(String partyCategoryId) {
this.partyCategoryId = partyCategoryId;
}
....
}
I get the following exception at deploy time when I try to deploy it against 4.3.0.CR2 libraries in JBoss eap 6.1, but deploys find against 4.2.0.Final libs which come bundled with jboss.
Caused by: org.hibernate.AnnotationException: Unknown Id.generator: customSharedIdGenerator
at org.hibernate.cfg.BinderHelper.makeIdGenerator(BinderHelper.java:640)
at org.hibernate.cfg.AnnotationBinder.processId(AnnotationBinder.java:2230)
at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:2136)
at org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:834)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:753)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3762)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3716)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1410)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1844)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)
... 11 more
I walked through the code in a debugger and found that in line 732 of AnnotationBinder.java
final InheritanceState.ElementsToProcess elementsToProcess = inheritanceState.getElementsToProcess();
getElementToProcess Is not returning the complete lets of annotations on the id method, in the failing case.
Please find a test case attached.
|