Merge pull request #12320 from anuragkumawat/JAVA-11558

JAVA-11558 Update article - Hibernate 5 Naming Strategy Configuration
This commit is contained in:
kwoyke 2022-06-06 20:08:19 +02:00 committed by GitHub
commit 7c6cfe56e9
2 changed files with 2 additions and 1 deletions

View File

@ -41,7 +41,7 @@ public class CustomPhysicalNamingStrategy implements PhysicalNamingStrategy {
final String newName = identifier.getText() final String newName = identifier.getText()
.replaceAll(regex, replacement) .replaceAll(regex, replacement)
.toLowerCase(); .toLowerCase();
return Identifier.toIdentifier(newName); return Identifier.toIdentifier(newName, identifier.isQuoted());
} }
} }

View File

@ -5,6 +5,7 @@ hibernate.dialect=org.hibernate.dialect.H2Dialect
hibernate.show_sql=false hibernate.show_sql=false
hibernate.hbm2ddl.auto=create-drop hibernate.hbm2ddl.auto=create-drop
hibernate.globally_quoted_identifiers=true
hibernate.physical_naming_strategy=com.baeldung.hibernate.namingstrategy.CustomPhysicalNamingStrategy hibernate.physical_naming_strategy=com.baeldung.hibernate.namingstrategy.CustomPhysicalNamingStrategy
hibernate.implicit_naming_strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl hibernate.implicit_naming_strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl