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 relation I assume that the issue is in
org.hibernate.bytecode.enhance.internal.bytebuddy.EnhancerImpl#collectCollectionFields, line 368:
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 has to be also implemented in both cases.