The {{EntityManagerFactoryBuilderImpl}} calls the {{buildBootstrapServiceRegistry}} like this:
{code:java} // Build the boot-strap service registry, which mainly handles class loader interactions final BootstrapServiceRegistry bsr = buildBootstrapServiceRegistry( integrationSettings, providedClassLoader, providedClassLoaderService);
// merge configuration sources and build the "standard" service registry final StandardServiceRegistryBuilder ssrBuilder = StandardServiceRegistryBuilder.forJpa( bsr );
final MergedSettings mergedSettings = mergeSettings( persistenceUnit, integrationSettings, ssrBuilder ); {code}
It would be better if we did it like this:
{ code:java noformat } Map mergedIntegrationSettings = null; final MergedSettings mergedSettings Properties properties = mergeSettings( persistenceUnit , .getProperties(); if ( properties != null ) { mergedIntegrationSettings = new HashMap( integrationSettings , ssrBuilder ); mergedIntegrationSettings.putAll( persistenceUnit.getProperties() ); }
// Build the boot-strap service registry, which mainly handles class loader interactions final BootstrapServiceRegistry bsr = buildBootstrapServiceRegistry( mergedSettings mergedIntegrationSettings != null ? mergedIntegrationSettings : integrationSettings , providedClassLoader, providedClassLoaderService ); // merge configuration sources and build the "standard" service registry final StandardServiceRegistryBuilder ssrBuilder = StandardServiceRegistryBuilder.forJpa( bsr ); { code noformat }
This way, we can use the PersistenceUnit properties as well, when scanning for an {{IntegratorProvider}}.
Currently, passing the {{IntegratorProvider}} works only in Spring, not in Java EE applications using the {{persistence.xml}} configuration file.
|
|