HHH-14020 add getServiceRegistry() to TypeBootstrapContext
This commit is contained in:
parent
ec5bbe4546
commit
f5062fca66
|
@ -101,7 +101,7 @@ public class BootstrapContextImpl implements BootstrapContext {
|
|||
this.representationStrategySelector = ManagedTypeRepresentationResolverStandard.INSTANCE;
|
||||
|
||||
this.typeConfiguration = new TypeConfiguration();
|
||||
this.beanInstanceProducer = new TypeBeanInstanceProducer( configService );
|
||||
this.beanInstanceProducer = new TypeBeanInstanceProducer( configService, serviceRegistry );
|
||||
this.sqmFunctionRegistry = new SqmFunctionRegistry();
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import org.hibernate.engine.config.spi.ConfigurationService;
|
|||
import org.hibernate.internal.util.ReflectHelper;
|
||||
import org.hibernate.resource.beans.spi.BeanInstanceProducer;
|
||||
import org.hibernate.type.spi.TypeBootstrapContext;
|
||||
import org.hibernate.service.ServiceRegistry;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.Map;
|
||||
|
@ -22,9 +23,11 @@ import java.util.Map;
|
|||
@Internal
|
||||
public class TypeBeanInstanceProducer implements BeanInstanceProducer, TypeBootstrapContext {
|
||||
private final ConfigurationService configurationService;
|
||||
private final ServiceRegistry serviceRegistry;
|
||||
|
||||
public TypeBeanInstanceProducer(ConfigurationService configurationService) {
|
||||
public TypeBeanInstanceProducer(ConfigurationService configurationService, ServiceRegistry serviceRegistry) {
|
||||
this.configurationService = configurationService;
|
||||
this.serviceRegistry = serviceRegistry;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -64,4 +67,9 @@ public class TypeBeanInstanceProducer implements BeanInstanceProducer, TypeBoots
|
|||
public Map<String, Object> getConfigurationSettings() {
|
||||
return configurationService.getSettings();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServiceRegistry getServiceRegistry() {
|
||||
return serviceRegistry;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
*/
|
||||
package org.hibernate.type.spi;
|
||||
|
||||
import org.hibernate.service.ServiceRegistry;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
@ -18,6 +20,6 @@ import java.util.Map;
|
|||
* @since 5.4
|
||||
*/
|
||||
public interface TypeBootstrapContext {
|
||||
@SuppressWarnings("unused")
|
||||
Map<String, Object> getConfigurationSettings();
|
||||
ServiceRegistry getServiceRegistry();
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ public class BootstrapContextTesting implements BootstrapContext {
|
|||
this.representationStrategySelector = ManagedTypeRepresentationResolverStandard.INSTANCE;
|
||||
|
||||
this.typeConfiguration = new TypeConfiguration();
|
||||
this.beanInstanceProducer = new TypeBeanInstanceProducer( configService );
|
||||
this.beanInstanceProducer = new TypeBeanInstanceProducer( configService, serviceRegistry );
|
||||
this.sqmFunctionRegistry = new SqmFunctionRegistry();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue