[hibernate-dev] JPA XML ORM descriptors id-class and id

Gail Badner gbadner at redhat.com
Tue May 8 18:13:47 EDT 2018


When an entity with an IdClass is mapped using XML ORM descriptors,
Hibernate requires the Id properties to be mapped as well, as in the
following example:

<entity class="Employee">

   <table name="entityobject"/>
   <id-class class="EmployeeId"/>
   <attributes>
      <id name="fname"/>
      <id name="lname"/>
   </attributes>
</entity>

If the <id> elements are not included, an exception is thrown:

"No identifier specified for entity: ..."

Should Hibernate require the <id> elements to be explicitly mapped, or
should it be able to determine this information by reflection from the
class configured by <id-class>?

Regards,
Gail


More information about the hibernate-dev mailing list