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 @@ private static void bindAny(
prop.setOptional( optional && value.isNullable() ); prop.setOptional( optional && value.isNullable() );
//composite FK columns are in the same table, so it's OK //composite FK columns are in the same table, so it's OK
propertyHolder.addProperty( prop, columns, inferredData.getDeclaringClass() ); propertyHolder.addProperty( prop, columns, inferredData.getDeclaringClass() );
binder.callAttributeBindersInSecondPass( prop );
} }
} }

View File

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

View File

@ -127,6 +127,7 @@ public void doSecondPass(Map<String, PersistentClass> persistentClasses) throws
else { else {
bindUnowned( persistentClasses, value, result ); bindUnowned( persistentClasses, value, result );
} }
binder.callAttributeBindersInSecondPass( result );
value.sortProperties(); value.sortProperties();
} }

View File

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