When extending from an @NaturalIdCache annotated entity then following exception raises during MetadataBuilding: java.lang.ClassCastException: org.hibernate.mapping.SingleTableSubclass cannot be cast to org.hibernate.mapping.RootClass at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.addEntityBinding(InFlightMetadataCollectorImpl.java:312) at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:808) at org.hibernate.boot.model.source.internal.annotations.AnnotationMetadataSourceProcessorImpl.processEntityHierarchies(AnnotationMetadataSourceProcessorImpl.java:250) at org.hibernate.boot.model.process.spi.MetadataBuildingProcess$1.processEntityHierarchies(MetadataBuildingProcess.java:231) at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:274) at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:84) at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:474) at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:1) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:689) ... Pull request inlcuding fix and testcase will follow very soon.. |