HHH-16099 Minor refactoring, extract local constants in UpdateCoordinatorStandard

This commit is contained in:
Sanne Grinovero 2023-01-25 18:02:13 +00:00
parent e00bdc7cb2
commit 9e033c8aea
1 changed files with 6 additions and 3 deletions

View File

@ -570,7 +570,8 @@ public class UpdateCoordinatorStandard extends AbstractMutationCoordinator imple
InclusionChecker dirtinessChecker,
boolean forceDynamicUpdate,
SharedSessionContractImplementor session) {
final AttributeMappingsList attributeMappings = entityPersister().getAttributeMappings();
final AbstractEntityPersister persister = entityPersister();
final AttributeMappingsList attributeMappings = persister.getAttributeMappings();
// NOTE:
// * `dirtyAttributeIndexes == null` means we had no snapshot and couldn't
@ -586,6 +587,8 @@ public class UpdateCoordinatorStandard extends AbstractMutationCoordinator imple
forceDynamicUpdate
);
final boolean[] propertyUpdateability = persister.getPropertyUpdateability();
for ( int attributeIndex = 0; attributeIndex < attributeMappings.size(); attributeIndex++ ) {
final AttributeMapping attributeMapping = attributeMappings.get( attributeIndex );
analysis.startingAttribute( attributeMapping );
@ -605,8 +608,8 @@ public class UpdateCoordinatorStandard extends AbstractMutationCoordinator imple
);
if ( analysis.currentAttributeAnalysis.isDirty() ) {
if ( !entityPersister().getPropertyUpdateability()[attributeIndex] ) {
LOG.ignoreImmutablePropertyModification( attributeMapping.getAttributeName(), entityPersister().getEntityName() );
if ( !propertyUpdateability[attributeIndex] ) {
LOG.ignoreImmutablePropertyModification( attributeMapping.getAttributeName(), persister.getEntityName() );
}
}
}