HHH-14047 Allow customization of the StandardServiceRegistryBuilder by extending the EntityManagerFactoryBuilderImpl

This commit is contained in:
Sanne Grinovero 2020-05-26 20:05:36 +01:00
parent 186c2a80e0
commit c59bea5ac4
1 changed files with 8 additions and 1 deletions

View File

@ -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 );