Minor code refactoring
This commit is contained in:
parent
371d2f1d49
commit
c105c34976
|
@ -264,17 +264,19 @@ public abstract class AbstractEntityEntry implements Serializable, EntityEntry {
|
||||||
this.loadedState = updatedState;
|
this.loadedState = updatedState;
|
||||||
setLockMode( LockMode.WRITE );
|
setLockMode( LockMode.WRITE );
|
||||||
|
|
||||||
if ( getPersister().isVersioned() ) {
|
final EntityPersister persister = getPersister();
|
||||||
|
if ( persister.isVersioned() ) {
|
||||||
this.version = nextVersion;
|
this.version = nextVersion;
|
||||||
getPersister().setValue( entity, getPersister().getVersionProperty(), nextVersion );
|
persister.setValue( entity, persister.getVersionProperty(), nextVersion );
|
||||||
}
|
}
|
||||||
|
|
||||||
ManagedTypeHelper.processIfSelfDirtinessTracker( entity, AbstractEntityEntry::clearDirtyAttributes );
|
ManagedTypeHelper.processIfSelfDirtinessTracker( entity, AbstractEntityEntry::clearDirtyAttributes );
|
||||||
|
|
||||||
getPersistenceContext().getSession()
|
final SharedSessionContractImplementor session = getPersistenceContext().getSession();
|
||||||
|
session
|
||||||
.getFactory()
|
.getFactory()
|
||||||
.getCustomEntityDirtinessStrategy()
|
.getCustomEntityDirtinessStrategy()
|
||||||
.resetDirty( entity, getPersister(), (Session) getPersistenceContext().getSession() );
|
.resetDirty( entity, persister, (Session) session );
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void clearDirtyAttributes(final SelfDirtinessTracker entity) {
|
private static void clearDirtyAttributes(final SelfDirtinessTracker entity) {
|
||||||
|
|
Loading…
Reference in New Issue