HHH-18414 remove duplicated call to callAttributeBindersInSecondPass()

alternative to proposed fix by @quaff

Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
Gavin King 2024-07-26 04:23:48 -06:00
parent f828b2a914
commit b5a5869b9b
4 changed files with 4 additions and 2 deletions

View File

@ -128,5 +128,6 @@ public class AnyBinder {
prop.setOptional( optional && value.isNullable() );
//composite FK columns are in the same table, so it's OK
propertyHolder.addProperty( prop, columns, inferredData.getDeclaringClass() );
binder.callAttributeBindersInSecondPass( prop );
}
}

View File

@ -1321,6 +1321,7 @@ public abstract class CollectionBinder {
throw new AssertionFailure( "DeclaringClass is not set in CollectionBinder while binding" );
}
propertyHolder.addProperty( prop, declaringClass );
binder.callAttributeBindersInSecondPass( prop );
}
@SuppressWarnings("deprecation")

View File

@ -127,6 +127,7 @@ public class OneToOneSecondPass implements SecondPass {
else {
bindUnowned( persistentClasses, value, result );
}
binder.callAttributeBindersInSecondPass( result );
value.sortProperties();
}

View File

@ -325,7 +325,7 @@ public class PropertyBinder {
return property;
}
private void callAttributeBindersInSecondPass(Property property) {
void callAttributeBindersInSecondPass(Property property) {
final InFlightMetadataCollector metadataCollector = buildingContext.getMetadataCollector();
if ( metadataCollector.isInSecondPass() ) {
callAttributeBinders( property, metadataCollector.getEntityBindingMap() );
@ -426,7 +426,6 @@ public class PropertyBinder {
handleOptional( property );
inferOptimisticLocking( property );
LOG.tracev( "Cascading {0} with {1}", name, cascade );
callAttributeBindersInSecondPass( property );
return property;
}