Hi,
we are using @Any annotation in our project and we want to use Hibernate OGM. We are running on EAP 6.1.1 and it works OK, but when we add modules to the EAP generated by OGM with https://github.com/hibernate/hibernate-ogm/pull/307 and add PU into persitence.xml we are getting an exception. I think it is because of some change between Hibernate 4.2.0 and 4.3.1. Any idea why on pure EAP it works but with the OGM modules doesn't?
Code:
Code:
@Entity
public class Report<T> implements Serializable {
@Any(metaColumn = @Column(name = "target_type"))
@AnyMetaDef(idType = "long", metaType = "string",
metaValues = {
@MetaValue(targetEntity = Project.class, value = "P"),
@MetaValue(targetEntity = Release.class, value = "R"),
@MetaValue(targetEntity = Artifact.class, value = "A")
})
@JoinColumn(name = "target_id")
private T target;
...
Stacktrace:
Code:
14:16:43,864 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 48) MSC000001: Failed to start service jboss.persistenceunit."build-tracker.ear/build-tracker-backend.jar#relationdbPU": org.jboss.msc.service.StartException in service jboss.persistenceunit."build-tracker.ear/build-tracker-backend.jar#relationdbPU": javax.persistence.PersistenceException: [PersistenceUnit: relationdbPU] Unable to build EntityManagerFactory
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:103)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]
at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.0.Final-redhat-1.jar:2.1.0.Final-redhat-1]
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: relationdbPU] Unable to build EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:930)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:92)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:200)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$600(PersistenceUnitServiceImpl.java:57)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:99)
... 4 more
Caused by: org.hibernate.AnnotationException: Property org.jboss.buildtracker.database.dao.model.Report.target has an unbound type and no explicit target entity. Resolve this Generic usage issue or set an explicit target attribute (eg @OneToMany(target=) or use an explicit @Type
at org.hibernate.cfg.PropertyContainer.assertTypesAreResolvable(PropertyContainer.java:140)
at org.hibernate.cfg.PropertyContainer.getProperties(PropertyContainer.java:118)
at org.hibernate.cfg.AnnotationBinder.addElementsOfClass(AnnotationBinder.java:1356)
at org.hibernate.cfg.InheritanceState.getElementsToProcess(InheritanceState.java:236)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:665)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3468)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3422)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1349)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1749)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:94)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:920)
... 9 more