After upgrading wildfly from 9.0.2 to 10.0.0.Final, we are experiencing issue with Hibernate MetadatasourceProcessor. Its throwing the following exception when one Entity is annotated with jpa and another entity extends it with hbm mapping.
{code} Caused by: org.hibernate.HibernateException: Not all named super-types (extends) were found : [com.sample.model.Sample] at org.hibernate.boot.model.source.internal.hbm.EntityHierarchyBuilder.buildHierarchies(EntityHierarchyBuilder.java:76) at org.hibernate.boot.model.source.internal.hbm.HbmMetadataSourceProcessorImpl.<init>(HbmMetadataSourceProcessorImpl.java:66) {code}
The hierarchy of entity as follows
{code} @Entity @Table(name = "tbl_sample") public class Sample extends Auditable { private Long id; @ManyToOne @JoinColumn(name = "relationA", nullable = true) private RelationA relationA; ... etc }
@MappedSuperClass public abstract class Auditable extends Persistable { //audit props }
@MappedSuperClass public abstract class Persistable { //common props }
public class BloodSample extends Sample { ..... }
BloodSample.hbm.xml
<hibernate-mapping package="com.sample.model .impl "> <joined-subclass name="BloodSample" table="tbl_blood_sample" extends="com.sample.model.Sample"> <key column="ID" />
<property name="sampleNo" column="sampleNo"/> etc.... </joined-subclass> </hibernate-mapping> {code}
When i turned on trace log the above exception is coming after the below debug log
{code} DEBUG [org.hibernate.boot.model.source.internal.hbm.EntityHierarchyBuilder] (ServerService Thread Pool -- 64) Entity super-type named as extends [com.sample.model.Sample] for subclass [Origin(name=vfs:/home/nick/servers/wildfly-10.0.0.Final/standalone/deployments/sample-ear.ear/lib/sample.jar/com/sample/model/ impl/ BloodSample.hbm.xml,type=INPUT_STREAM):com.sample.model. impl. BloodSample] not found {code}
Full discussion can be found here : https://developer.jboss.org/message/952546 and here http://stackoverflow.com/questions/35910271/spring-could-not-create-entitymanagerfactory-after-upgrading-to-hibernate-5-x |
|