mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Reinstate support for Hibernate < 5.5
See gh-27352
This commit is contained in:
parent
6d50e65572
commit
51fedd6528
@ -173,18 +173,18 @@ public class HibernateProperties {
|
|||||||
|
|
||||||
private void applyNamingStrategies(Map<String, Object> properties) {
|
private void applyNamingStrategies(Map<String, Object> properties) {
|
||||||
applyNamingStrategy(properties, AvailableSettings.IMPLICIT_NAMING_STRATEGY, this.implicitStrategy,
|
applyNamingStrategy(properties, AvailableSettings.IMPLICIT_NAMING_STRATEGY, this.implicitStrategy,
|
||||||
SpringImplicitNamingStrategy.class.getName());
|
() -> SpringImplicitNamingStrategy.class.getName());
|
||||||
applyNamingStrategy(properties, AvailableSettings.PHYSICAL_NAMING_STRATEGY, this.physicalStrategy,
|
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,
|
private void applyNamingStrategy(Map<String, Object> properties, String key, Object strategy,
|
||||||
Object defaultStrategy) {
|
Supplier<String> defaultStrategy) {
|
||||||
if (strategy != null) {
|
if (strategy != null) {
|
||||||
properties.put(key, strategy);
|
properties.put(key, strategy);
|
||||||
}
|
}
|
||||||
else if (defaultStrategy != null && !properties.containsKey(key)) {
|
else {
|
||||||
properties.put(key, defaultStrategy);
|
properties.computeIfAbsent(key, (k) -> defaultStrategy.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
|
Loading…
Reference in New Issue
Block a user