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

Support private persistent attributes in @MappedSuperclas

    Details

    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true

      Description

      When bytecode enhancement is enabled a change to a property in a mapped superclass does not mark the entity dirty. Subsequently that change is not persisted.

      Find attached a test case. Run with "mvn test". The change to setParentValue() does not get applied on flush. When enhancement is turned off, the test case works as expected.

      2016-07-21 20:15:35,928	DEBUG org.hibernate.SQL	- select someentity0_.id as id1_0_0_, someentity0_.parentValue as parentVa2_0_0_, someentity0_.entityValue as entityVa3_0_0_ from SomeEntity someentity0_ where someentity0_.id=?
      2016-07-21 20:15:36,009	DEBUG org.hibernate.SQL	- update SomeEntity set parentValue=?, entityValue=? where id=?
      2016-07-21 20:15:36,025	DEBUG org.hibernate.SQL	- select someentity0_.id as id1_0_0_, someentity0_.parentValue as parentVa2_0_0_, someentity0_.entityValue as entityVa3_0_0_ from SomeEntity someentity0_ where someentity0_.id=?
      2016-07-21 20:15:36,033	DEBUG org.hibernate.SQL	- select someentity0_.id as id1_0_0_, someentity0_.parentValue as parentVa2_0_0_, someentity0_.entityValue as entityVa3_0_0_ from SomeEntity someentity0_ where someentity0_.id=?
      Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 12.16 sec <<< FAILURE!
      test(eu.pinske.test.TrackingTest)  Time elapsed: 11.389 sec  <<< FAILURE!
      org.junit.ComparisonFailure: superclass change not persisted expected:<[y]> but was:<[b]>
      

      The generated methods in the mapped superclass do not delegate to any dirty tracker.
      I would expect that e.g. the entity overrides the superclass methods and in there delegates to its dirty tracker.

        Attachments

          Issue links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: