Uploaded image for project: 'Hibernate ORM'
  1. HHH-9114

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

    Details

    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true

      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

        Attachments

          Issue links

            Activity

              People

              • Votes:
                6 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: