From 76e305ba758a035db57b34d6aff97d44767f4365 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Tue, 26 May 2020 20:05:36 +0100 Subject: [PATCH] HHH-14047 Allow customization of the StandardServiceRegistryBuilder by extending the EntityManagerFactoryBuilderImpl --- .../boot/internal/EntityManagerFactoryBuilderImpl.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/jpa/boot/internal/EntityManagerFactoryBuilderImpl.java b/hibernate-core/src/main/java/org/hibernate/jpa/boot/internal/EntityManagerFactoryBuilderImpl.java index 4aa26f7a01..149300f1c4 100644 --- a/hibernate-core/src/main/java/org/hibernate/jpa/boot/internal/EntityManagerFactoryBuilderImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/jpa/boot/internal/EntityManagerFactoryBuilderImpl.java @@ -212,7 +212,7 @@ public class EntityManagerFactoryBuilderImpl implements EntityManagerFactoryBuil ); // merge configuration sources and build the "standard" service registry - final StandardServiceRegistryBuilder ssrBuilder = StandardServiceRegistryBuilder.forJpa( bsr ); + final StandardServiceRegistryBuilder ssrBuilder = getStandardServiceRegistryBuilder( bsr ); final MergedSettings mergedSettings = mergeSettings( persistenceUnit, integrationSettings, ssrBuilder ); @@ -280,6 +280,13 @@ public class EntityManagerFactoryBuilderImpl implements EntityManagerFactoryBuil metamodelBuilder.applyTempClassLoader( null ); } + /** + * Extension point for subclasses. Used by Hibernate Reactive + */ + protected StandardServiceRegistryBuilder getStandardServiceRegistryBuilder(BootstrapServiceRegistry bsr) { + return StandardServiceRegistryBuilder.forJpa( bsr ); + } + private void applyMetadataBuilderContributor() { Object metadataBuilderContributorSetting = configurationValues.get( METADATA_BUILDER_CONTRIBUTOR );