From 9575b4b72370fcb02e76c1f6dc09261d302c6817 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 26 Jul 2017 14:49:42 +0200 Subject: [PATCH] Polish "Polish Hibernate naming strategy doc" Closes gh-9763 --- spring-boot-docs/src/main/asciidoc/howto.adoc | 22 +++++++++---------- spring-boot-docs/src/main/asciidoc/index.adoc | 1 + 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-docs/src/main/asciidoc/howto.adoc index f1cf096580..8b432fb424 100644 --- a/spring-boot-docs/src/main/asciidoc/howto.adoc +++ b/spring-boot-docs/src/main/asciidoc/howto.adoc @@ -1693,19 +1693,17 @@ properties (with the prefix stripped) when the local `EntityManagerFactory` is c [[howto-configure-hibernate-naming-strategy]] === Configure Hibernate Naming Strategy -Hibernate uses http://docs.jboss.org/hibernate/orm/5.2/userguide/html_single/Hibernate_User_Guide.html#naming[two different naming strategies] -to map names in your object model to names in your database. Spring Boot provides properties for configuring -these naming strategies: +Hibernate uses {hibernate-documentation}#naming[two different naming strategies] to map +names from the object model to the corresponding database names. The fully qualified class +name of the physical and implicit strategy implementations can be configured using the +`spring.jpa.hibernate.naming.physical-strategy` and +`spring.jpa.hibernate.naming.implicit-strategy` properties respectively. -* `spring.jpa.hibernate.naming.physical-strategy` -* `spring.jpa.hibernate.naming.implicit-strategy` - -The properties should be configured with the fully qualified class name of a strategy implementation. - -Spring Boot configures `SpringPhysicalNamingStrategy` by default. This implementation provides the same table -structure as Hibernate 4: all dots are replaced by underscores and camel cases are -replaced by underscores as well. By default, all table names are generated in lower case -but it is possible to override that flag if your schema requires it. +Spring Boot configures the physical naming strategy with `SpringPhysicalNamingStrategy` by +default. This implementation provides the same table structure as Hibernate 4: all dots +are replaced by underscores and camel cases are replaced by underscores as well. By +default, all table names are generated in lower case but it is possible to override that +flag if your schema requires it. Concretely, a `TelephoneNumber` entity will be mapped to the `telephone_number` table. diff --git a/spring-boot-docs/src/main/asciidoc/index.adoc b/spring-boot-docs/src/main/asciidoc/index.adoc index 5244677f0d..fc551a4f1b 100644 --- a/spring-boot-docs/src/main/asciidoc/index.adoc +++ b/spring-boot-docs/src/main/asciidoc/index.adoc @@ -52,6 +52,7 @@ Phillip Webb; Dave Syer; Josh Long; Stéphane Nicoll; Rob Winch; Andy Wilkinson; :ant-manual: http://ant.apache.org/manual :code-examples: ../java/org/springframework/boot :gradle-user-guide: https://docs.gradle.org/3.4.1/userguide +:hibernate-documentation: http://docs.jboss.org/hibernate/orm/5.2/userguide/html_single/Hibernate_User_Guide.html :jetty-documentation: https://www.eclipse.org/jetty/documentation/9.4.x :tomcat-documentation: https://tomcat.apache.org/tomcat-8.5-doc // ======================================================================================