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

The following examples show how to use org.springframework.boot.autoconfigure.orm.jpa.HibernatePropertiesCustomizer. 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: EntityManagerFactoryServiceImpl.java    From multitenant with Apache License 2.0 5 votes vote down vote up
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 File: LocJpaConfiguration.java    From loc-framework with 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
Source File: CacheConfiguration.java    From java-microservices-examples with 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 #4
Source File: CacheConfiguration.java    From jhipster-online with 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 File: NamingConfig.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
public HibernatePropertiesCustomizer customizer() {
    return new HibernateConfig();
}