extract a method

This commit is contained in:
Gavin 2022-12-24 15:55:44 +01:00 committed by Gavin King
parent e918f92f48
commit 408e0ec436
1 changed files with 43 additions and 36 deletions

View File

@ -2523,7 +2523,21 @@ public class ModelBinder {
// NOTE : Property#is refers to whether a property is lazy via bytecode enhancement (not proxies)
property.setLazy( singularAttributeSource.isBytecodeLazy() );
final GenerationTiming timing = singularAttributeSource.getGenerationTiming();
handleGenerationTiming( mappingDocument, propertySource, property, singularAttributeSource.getGenerationTiming() );
}
property.setMetaAttributes( propertySource.getToolingHintContext().getMetaAttributeMap() );
if ( log.isDebugEnabled() ) {
log.debug( "Mapped property: " + propertySource.getName() + " -> [" + columns( property.getValue() ) + "]" );
}
}
private static void handleGenerationTiming(
MappingDocument mappingDocument,
AttributeSource propertySource,
Property property,
GenerationTiming timing) {
if ( timing != null ) {
if ( (timing == GenerationTiming.INSERT || timing == GenerationTiming.UPDATE)
&& property.getValue() instanceof SimpleValue
@ -2561,13 +2575,6 @@ public class ModelBinder {
}
}
property.setMetaAttributes( propertySource.getToolingHintContext().getMetaAttributeMap() );
if ( log.isDebugEnabled() ) {
log.debug( "Mapped property: " + propertySource.getName() + " -> [" + columns( property.getValue() ) + "]" );
}
}
private void bindComponent(
MappingDocument sourceDocument,
EmbeddableSource embeddableSource,