We're updating the issue view to help you get more done. 

@IdClass with @MappedSuperclass results in "property not found"

Description

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

Environment

4.3.5-final

Status

Assignee

Chris Cranford

Reporter

Samuel Nelson

Fix versions

Affects versions

4.3.5
5.0.8
5.2.8

Priority

Major