Skip to content

Commit c2aca4d

Browse files
committed
Document SpringPhysicalNamingStrategy
Closes gh-9084
1 parent fc38c1b commit c2aca4d

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

spring-boot-docs/src/main/asciidoc/howto.adoc

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,12 +1898,24 @@ The most common options to set are:
18981898
In addition all properties in `+spring.jpa.properties.*+` are passed through as normal JPA
18991899
properties (with the prefix stripped) when the local `EntityManagerFactory` is created.
19001900

1901+
1902+
1903+
[[howto-configure-hibernate-naming-strategy]]
1904+
=== Configure Hibernate Naming Strategy
19011905
Spring Boot provides a consistent naming strategy regardless of the Hibernate generation
19021906
that you are using. If you are using Hibernate 4, you can customize it using
19031907
`spring.jpa.hibernate.naming.strategy`; Hibernate 5 defines a `Physical` and `Implicit`
1904-
naming strategies: Spring Boot configures `SpringPhysicalNamingStrategy` by default. This
1905-
implementation provides the same table structure as Hibernate 4. If you'd rather use
1906-
Hibernate 5's default instead, set the following property:
1908+
naming strategies.
1909+
1910+
Spring Boot configures `SpringPhysicalNamingStrategy` by default. This implementation
1911+
provides the same table structure as Hibernate 4: all dots are replaced by underscores and
1912+
camel cases are replaced by underscores as well. By default, all table names are generated
1913+
in lower case but it is possible to override that flag if your schema requires it.
1914+
1915+
Concretely, the `TelephoneNumber` entity will use a `telephone_number` with the default
1916+
strategy.
1917+
1918+
If you'd rather use Hibernate 5's default instead, set the following property:
19071919

19081920
[indent=0,subs="verbatim,quotes,attributes"]
19091921
----

0 commit comments

Comments
 (0)