Java Code Examples for org.hibernate.internal.util.config.ConfigurationHelper#resolvePlaceHolders()

The following examples show how to use org.hibernate.internal.util.config.ConfigurationHelper#resolvePlaceHolders() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ReactiveServiceRegistryBuilder.java    From hibernate-reactive with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * Build the StandardServiceRegistry.
 *
 * @return The StandardServiceRegistry.
 */
@SuppressWarnings("unchecked")
public StandardServiceRegistry build() {
    applyServiceContributingIntegrators();
    applyServiceContributors();

    @SuppressWarnings("rawtypes")
    final Map settingsCopy = new HashMap( settings );
    settingsCopy.put( org.hibernate.boot.cfgxml.spi.CfgXmlAccessService.LOADED_CONFIG_KEY, aggregatedCfgXml );
    ConfigurationHelper.resolvePlaceHolders( settingsCopy );

    return new StandardServiceRegistryImpl(
            autoCloseRegistry,
            bootstrapServiceRegistry,
            initiators,
            providedServices,
            settingsCopy
    );
}
 
Example 2
Source File: StandardServiceRegistryBuilder.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Build the StandardServiceRegistry.
 *
 * @return The StandardServiceRegistry.
 */
@SuppressWarnings("unchecked")
public StandardServiceRegistry build() {
	applyServiceContributingIntegrators();
	applyServiceContributors();

	final Map settingsCopy = new HashMap();
	settingsCopy.putAll( settings );
	settingsCopy.put( org.hibernate.boot.cfgxml.spi.CfgXmlAccessService.LOADED_CONFIG_KEY, aggregatedCfgXml );
	Environment.verifyProperties( settingsCopy );
	ConfigurationHelper.resolvePlaceHolders( settingsCopy );

	return new StandardServiceRegistryImpl(
			autoCloseRegistry,
			bootstrapServiceRegistry,
			initiators,
			providedServices,
			settingsCopy
	);
}
 
Example 3
Source File: BaseCoreFunctionalTestCase.java    From google-cloud-spanner-hibernate with GNU Lesser General Public License v2.1 5 votes vote down vote up
protected StandardServiceRegistryImpl buildServiceRegistry(BootstrapServiceRegistry bootRegistry, Configuration configuration) {
  Properties properties = new Properties();
  properties.putAll( configuration.getProperties() );
  ConfigurationHelper.resolvePlaceHolders( properties );

  StandardServiceRegistryBuilder cfgRegistryBuilder = configuration.getStandardServiceRegistryBuilder();

  StandardServiceRegistryBuilder registryBuilder = new StandardServiceRegistryBuilder( bootRegistry, cfgRegistryBuilder.getAggregatedCfgXml() )
      .applySettings( properties );

  prepareBasicRegistryBuilder( registryBuilder );
  return (StandardServiceRegistryImpl) registryBuilder.build();
}
 
Example 4
Source File: ManagedProviderConnectionHelper.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
private static StandardServiceRegistryImpl createServiceRegistry(Properties properties) {
	Environment.verifyProperties( properties );
	ConfigurationHelper.resolvePlaceHolders( properties );
	return (StandardServiceRegistryImpl) new StandardServiceRegistryBuilder().applySettings( properties ).build();
}