HHH-12444 - Introduce BootstrapContext

HHH-12443 - Introduce TypeConfiguration
This commit is contained in:
Andrea Boriero 2018-03-15 15:34:53 +00:00 committed by Steve Ebersole
parent 11462e7860
commit ce36b3bb08
1 changed files with 4 additions and 20 deletions

View File

@ -122,9 +122,6 @@ public class InFlightMetadataCollectorImpl implements InFlightMetadataCollector
private final BootstrapContext bootstrapContext; private final BootstrapContext bootstrapContext;
private final MetadataBuildingOptions options; private final MetadataBuildingOptions options;
private final TypeConfiguration typeConfiguration;
private final TypeResolver typeResolver;
private final AttributeConverterManager attributeConverterManager = new AttributeConverterManager(); private final AttributeConverterManager attributeConverterManager = new AttributeConverterManager();
@ -173,24 +170,12 @@ public class InFlightMetadataCollectorImpl implements InFlightMetadataCollector
public InFlightMetadataCollectorImpl( public InFlightMetadataCollectorImpl(
BootstrapContext bootstrapContext, BootstrapContext bootstrapContext,
MetadataBuildingOptions options) { MetadataBuildingOptions options) {
this( bootstrapContext, options, bootstrapContext.getTypeConfiguration().getTypeResolver() );
}
/**
* @deprecated Use {@link InFlightMetadataCollectorImpl#InFlightMetadataCollectorImpl(BootstrapContext, MetadataBuildingOptions)} instead.
*/
@Deprecated
public InFlightMetadataCollectorImpl(
BootstrapContext bootstrapContext,
MetadataBuildingOptions options,
TypeResolver typeResolver) {
this.bootstrapContext = bootstrapContext; this.bootstrapContext = bootstrapContext;
this.uuid = UUID.randomUUID(); this.uuid = UUID.randomUUID();
this.options = options; this.options = options;
this.typeConfiguration = bootstrapContext.getTypeConfiguration();
this.typeResolver = typeResolver;
this.identifierGeneratorFactory = options.getServiceRegistry().getService( MutableIdentifierGeneratorFactory.class ); this.identifierGeneratorFactory = options.getServiceRegistry()
.getService( MutableIdentifierGeneratorFactory.class );
for ( Map.Entry<String, SQLFunction> sqlFunctionEntry : bootstrapContext.getSqlFunctions().entrySet() ) { for ( Map.Entry<String, SQLFunction> sqlFunctionEntry : bootstrapContext.getSqlFunctions().entrySet() ) {
if ( sqlFunctionMap == null ) { if ( sqlFunctionMap == null ) {
@ -221,12 +206,12 @@ public class InFlightMetadataCollectorImpl implements InFlightMetadataCollector
@Override @Override
public TypeConfiguration getTypeConfiguration() { public TypeConfiguration getTypeConfiguration() {
return typeConfiguration; return bootstrapContext.getTypeConfiguration();
} }
@Override @Override
public TypeResolver getTypeResolver() { public TypeResolver getTypeResolver() {
return typeResolver; return bootstrapContext.getTypeConfiguration().getTypeResolver();
} }
@Override @Override
@ -2250,7 +2235,6 @@ public class InFlightMetadataCollectorImpl implements InFlightMetadataCollector
return new MetadataImpl( return new MetadataImpl(
uuid, uuid,
options, options,
typeConfiguration,
identifierGeneratorFactory, identifierGeneratorFactory,
entityBindingMap, entityBindingMap,
mappedSuperClasses, mappedSuperClasses,