mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-15 01:07:30 +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) {
|
||||
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…
Reference in New Issue
Block a user