|
If class heirarchy defines a IdClass with a property in the @MappedSuperclass and a property in the @Entity class, the entity manager throws an AnnotationException:
Caused by: org.hibernate.AnnotationException: Property of @IdClass not found in entity com.jpabugreport.Employee: ssn at org.hibernate.cfg.AnnotationBinder.fillComponent(AnnotationBinder.java:2603) at org.hibernate.cfg.AnnotationBinder.bindIdClass(AnnotationBinder.java:2716) at org.hibernate.cfg.AnnotationBinder.mapAsIdClass(AnnotationBinder.java:1041) at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:781) at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3788) at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3742) 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) ... 49 more
This issue is mentioned by others here: http://stackoverflow.com/questions/4216102/composite-key-in-jpa-hibernate-with-inherited-class
Attached is test project to reproduce issue
|