Reinstate support for Hibernate < 5.5

See gh-27352
pull/27405/head
Andy Wilkinson 3 years ago
parent 6d50e65572
commit 51fedd6528

@ -173,18 +173,18 @@ public class HibernateProperties {
private void applyNamingStrategies(Map<String, Object> properties) {
applyNamingStrategy(properties, AvailableSettings.IMPLICIT_NAMING_STRATEGY, this.implicitStrategy,
SpringImplicitNamingStrategy.class.getName());
() -> SpringImplicitNamingStrategy.class.getName());
applyNamingStrategy(properties, AvailableSettings.PHYSICAL_NAMING_STRATEGY, this.physicalStrategy,
CamelCaseToUnderscoresNamingStrategy.class.getName());
() -> CamelCaseToUnderscoresNamingStrategy.class.getName());
}
private void applyNamingStrategy(Map<String, Object> properties, String key, Object strategy,
Object defaultStrategy) {
Supplier<String> defaultStrategy) {
if (strategy != null) {
properties.put(key, strategy);
}
else if (defaultStrategy != null && !properties.containsKey(key)) {
properties.put(key, defaultStrategy);
else {
properties.computeIfAbsent(key, (k) -> defaultStrategy.get());
}
}

@ -0,0 +1 @@
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
Loading…
Cancel
Save