Hi guys,
I am using Annotations CR1, EntityManager CR1, and Hibernate 3.2 CR2 and ran into some troubles with polymorphic associations..
I have the following class Xyz, which is a super class for a couple of entity classes:
@MappedSuperclass
public abstract class Xyz{...}
The following association to Xyz does not work (see exception below)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumns({...})
private Xyz test;
Each entity is annotated with
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS).
I am look forward to any help! Thank you!
Here's the execption:
javax.persistence.PersistenceException: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on play.abc.test references an unknown entity: play.Xyz
at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:196)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27)
...
Caused by: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on play.abc.test references an unknown entity: play.Xyz
at org.hibernate.cfg.FkSecondPass.doSecondPass(FkSecondPass.java:40)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:261)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1034)
at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:868)
at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:163)
at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:641)
at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:134)
at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:188)
... 20 more
|