|
|
|
@ -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());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|