Java Code Examples for org.springframework.boot.autoconfigure.orm.jpa.HibernatePropertiesCustomizer

The following examples show how to use org.springframework.boot.autoconfigure.orm.jpa.HibernatePropertiesCustomizer. These examples are extracted from open source projects. 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
public EntityManagerFactoryServiceImpl(
		ObjectProvider<List<SchemaManagementProvider>> providers,
		ObjectProvider<PhysicalNamingStrategy> physicalNamingStrategy,
		ObjectProvider<ImplicitNamingStrategy> implicitNamingStrategy,
		ObjectProvider<List<HibernatePropertiesCustomizer>> hibernatePropertiesCustomizers) {
	this.defaultDdlAutoProvider = new HibernateDefaultDdlAutoProvider(
			providers.getIfAvailable(Collections::emptyList));
	this.physicalNamingStrategy = physicalNamingStrategy.getIfAvailable();
	this.implicitNamingStrategy = implicitNamingStrategy.getIfAvailable();
	this.hibernatePropertiesCustomizers = hibernatePropertiesCustomizers
			.getIfAvailable(() -> Collections.emptyList());
}
 
Example 2
Source Project: loc-framework   Source File: LocJpaConfiguration.java    License: MIT License 5 votes vote down vote up
protected Map<String, Object> getVendorProperties() {
  String defaultDdlMode = "none";
  LinkedList<HibernatePropertiesCustomizer> customizers = new LinkedList<>();
  if (hibernatePropertiesCustomizers != null) {
    customizers.addAll(hibernatePropertiesCustomizers);
  }
  customizers.addFirst(new LocJpaConfiguration.NamingStrategiesHibernatePropertiesCustomizer(
      physicalNamingStrategy, implicitNamingStrategy));
  return new LinkedHashMap<>(hibernateProperties
      .determineHibernateProperties(jpaProperties.getProperties(),
          new HibernateSettings().ddlAuto(() -> defaultDdlMode)
              .hibernatePropertiesCustomizers(customizers)));
}
 
Example 3
@Bean
public HibernatePropertiesCustomizer hibernatePropertiesCustomizer(javax.cache.CacheManager cacheManager) {
    return hibernateProperties -> hibernateProperties.put(ConfigSettings.CACHE_MANAGER, cacheManager);
}
 
Example 4
Source Project: jhipster-online   Source File: CacheConfiguration.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
public HibernatePropertiesCustomizer hibernatePropertiesCustomizer(javax.cache.CacheManager cacheManager) {
    return hibernateProperties -> hibernateProperties.put(ConfigSettings.CACHE_MANAGER, cacheManager);
}
 
Example 5
Source Project: tutorials   Source File: NamingConfig.java    License: MIT License 4 votes vote down vote up
@Bean
public HibernatePropertiesCustomizer customizer() {
    return new HibernateConfig();
}