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

Envers cannot support @IdClass referencing foreign entity identifier

    Details

      Description

      Reference:
      https://wiki.eclipse.org/EclipseLink/Examples/JPA/2.0/DerivedIdentifiers
      https://docs.jboss.org/hibernate/stable/annotations/reference/en/html_single/#d0e1112

      When using an @IdClass that references another entity (in a One|ManyToOne relationship), the @IdClass should use the type of the primary key of the referenced entity.

      This is a completely supported scenario in Hibernate and any JPA compliant provider. However, when you enable Envers for the entity (i.e. make it @Audited), exceptions start to occur as Envers expects the types of the @IdClass to match the same fields in the entity.

      I have created a test case and an associated fix in the referenced pull request.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 8h
                8h
                Remaining:
                Remaining Estimate - 8h
                8h
                Logged:
                Time Spent - Not Specified
                Not Specified