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

Support private persistent attributes in @MappedSuperclas

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.

1 2 3 4 5 6 7 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.

Environment

None

Status

Assignee

Luis Barreiro

Reporter

Alexander Pinske

Fix versions

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.2.1

Priority

Major