JAVA-11558 Update article - Hibernate 5 Naming Strategy Configuration

This commit is contained in:
anuragkumawat 2022-06-06 22:07:37 +05:30
parent 908387dbfb
commit 8813f1c809
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()
.replaceAll(regex, replacement)
.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.hbm2ddl.auto=create-drop
hibernate.globally_quoted_identifiers=true
hibernate.physical_naming_strategy=com.baeldung.hibernate.namingstrategy.CustomPhysicalNamingStrategy
hibernate.implicit_naming_strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl