Skip to content

Commit f5062fc

Browse files
gavinkingsebersole
authored andcommitted
HHH-14020 add getServiceRegistry() to TypeBootstrapContext
1 parent ec5bbe4 commit f5062fc

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

hibernate-core/src/main/java/org/hibernate/boot/internal/BootstrapContextImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public BootstrapContextImpl(
101101
this.representationStrategySelector = ManagedTypeRepresentationResolverStandard.INSTANCE;
102102

103103
this.typeConfiguration = new TypeConfiguration();
104-
this.beanInstanceProducer = new TypeBeanInstanceProducer( configService );
104+
this.beanInstanceProducer = new TypeBeanInstanceProducer( configService, serviceRegistry );
105105
this.sqmFunctionRegistry = new SqmFunctionRegistry();
106106
}
107107

hibernate-core/src/main/java/org/hibernate/boot/internal/TypeBeanInstanceProducer.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.hibernate.internal.util.ReflectHelper;
1111
import org.hibernate.resource.beans.spi.BeanInstanceProducer;
1212
import org.hibernate.type.spi.TypeBootstrapContext;
13+
import org.hibernate.service.ServiceRegistry;
1314

1415
import java.lang.reflect.Constructor;
1516
import java.util.Map;
@@ -22,9 +23,11 @@
2223
@Internal
2324
public class TypeBeanInstanceProducer implements BeanInstanceProducer, TypeBootstrapContext {
2425
private final ConfigurationService configurationService;
26+
private final ServiceRegistry serviceRegistry;
2527

26-
public TypeBeanInstanceProducer(ConfigurationService configurationService) {
28+
public TypeBeanInstanceProducer(ConfigurationService configurationService, ServiceRegistry serviceRegistry) {
2729
this.configurationService = configurationService;
30+
this.serviceRegistry = serviceRegistry;
2831
}
2932

3033
@Override
@@ -64,4 +67,9 @@ public <B> B produceBeanInstance(String name, Class<B> beanType) {
6467
public Map<String, Object> getConfigurationSettings() {
6568
return configurationService.getSettings();
6669
}
70+
71+
@Override
72+
public ServiceRegistry getServiceRegistry() {
73+
return serviceRegistry;
74+
}
6775
}

hibernate-core/src/main/java/org/hibernate/type/spi/TypeBootstrapContext.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
*/
55
package org.hibernate.type.spi;
66

7+
import org.hibernate.service.ServiceRegistry;
8+
79
import java.util.Map;
810

911
/**
@@ -18,6 +20,6 @@
1820
* @since 5.4
1921
*/
2022
public interface TypeBootstrapContext {
21-
@SuppressWarnings("unused")
2223
Map<String, Object> getConfigurationSettings();
24+
ServiceRegistry getServiceRegistry();
2325
}

hibernate-core/src/test/java/org/hibernate/orm/test/boot/models/BootstrapContextTesting.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public BootstrapContextTesting(
106106
this.representationStrategySelector = ManagedTypeRepresentationResolverStandard.INSTANCE;
107107

108108
this.typeConfiguration = new TypeConfiguration();
109-
this.beanInstanceProducer = new TypeBeanInstanceProducer( configService );
109+
this.beanInstanceProducer = new TypeBeanInstanceProducer( configService, serviceRegistry );
110110
this.sqmFunctionRegistry = new SqmFunctionRegistry();
111111
}
112112

0 commit comments

Comments
 (0)