extract a method
This commit is contained in:
parent
e918f92f48
commit
408e0ec436
|
@ -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
|
||||
|
@ -2535,7 +2549,7 @@ public class ModelBinder {
|
|||
);
|
||||
}
|
||||
if ( timing != GenerationTiming.NEVER ) {
|
||||
property.setValueGeneratorCreator( context -> new GeneratedGeneration( timing.getEquivalent() ) );
|
||||
property.setValueGeneratorCreator(context -> new GeneratedGeneration( timing.getEquivalent() ) );
|
||||
|
||||
// generated properties can *never* be insertable...
|
||||
if ( property.isInsertable() && timing.includesInsert() ) {
|
||||
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue