mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-08 04:08:19 +00:00
HHH-14020 add getServiceRegistry() to TypeBootstrapContext
This commit is contained in:
parent
ec5bbe4546
commit
f5062fca66
@ -101,7 +101,7 @@ public BootstrapContextImpl(
|
||||
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.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 @@
|
||||
@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 <B> B produceBeanInstance(String name, Class<B> beanType) {
|
||||
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 @@
|
||||
* @since 5.4
|
||||
*/
|
||||
public interface TypeBootstrapContext {
|
||||
@SuppressWarnings("unused")
|
||||
Map<String, Object> getConfigurationSettings();
|
||||
ServiceRegistry getServiceRegistry();
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ public BootstrapContextTesting(
|
||||
this.representationStrategySelector = ManagedTypeRepresentationResolverStandard.INSTANCE;
|
||||
|
||||
this.typeConfiguration = new TypeConfiguration();
|
||||
this.beanInstanceProducer = new TypeBeanInstanceProducer( configService );
|
||||
this.beanInstanceProducer = new TypeBeanInstanceProducer( configService, serviceRegistry );
|
||||
this.sqmFunctionRegistry = new SqmFunctionRegistry();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user