While trying to solve HHH-12425, I discovered that during bytecode enhancement, ExtendedSelfDirtinessTracker is not assigned in all cases:
As soon as a entity collection has field level access, ExtendedSelfDirtinessTracker is not implemented. When the collection is property level accessed, ExtendedSelfDirtinessTracker is implemented.
In this relationorg.hibernate.bytecode.enhance.internal.bytebuddy.EnhancerImpl#collectCollectionFieI assume that the issue is in org.hibernate.bytecode.enhance.internal.bytebuddy.EnhancerImpl#collectCollectionFields, line 368: {code:java} if ( enhancementContext.isPersistentField( ctField ) && !enhancementContext.isMappedCollection( ctField ) ) { {code}
With field level access, isMappedCollection evaluates to true, so the collection field is not added. With property level access, isMappedCollection does not evaluate to true. From my understanding, both cases should cause the collection field to be added, so ExtendedSelfDirtinessTracker can has to be also implemented in both cases.
Test case_ case: https://github.com/nikowitt/hibernate-test-case-templates/tree/HHH-12593 |
|