diff --git a/src/main/java/com/loafle/overflow/central/spring/JdbcConfiguration.java b/src/main/java/com/loafle/overflow/central/spring/JdbcConfiguration.java index a5cd527..0ab01cb 100644 --- a/src/main/java/com/loafle/overflow/central/spring/JdbcConfiguration.java +++ b/src/main/java/com/loafle/overflow/central/spring/JdbcConfiguration.java @@ -44,6 +44,10 @@ public class JdbcConfiguration implements TransactionManagementConfigurer { private String dialect; @Value("${jpa.hibernate.ddl-auto}") private String hbm2ddlAuto; + @Value("${jpa.show-sql}") + private Boolean jpaShowSQL; + @Value("${jpa.hibernate.naming.physical-strategy}") + private String namingPhysicalStrategy; @Bean public DataSource configureDataSource() { @@ -65,7 +69,8 @@ public class JdbcConfiguration implements TransactionManagementConfigurer { Properties jpaProperties = new Properties(); jpaProperties.put(Environment.DIALECT, dialect); jpaProperties.put(Environment.HBM2DDL_AUTO, hbm2ddlAuto); - jpaProperties.put(Environment.SHOW_SQL, true); + jpaProperties.put(Environment.SHOW_SQL, this.jpaShowSQL); + jpaProperties.put(Environment.PHYSICAL_NAMING_STRATEGY, this.namingPhysicalStrategy); entityManagerFactoryBean.setJpaProperties(jpaProperties); diff --git a/src/main/resources/profiles/development/database.properties b/src/main/resources/profiles/development/database.properties index 8bdad2d..4cb1fb5 100644 --- a/src/main/resources/profiles/development/database.properties +++ b/src/main/resources/profiles/development/database.properties @@ -3,8 +3,8 @@ datasource.username=overflow datasource.password=qwer5795 datasource.driver-class-name=org.postgresql.Driver -jpa.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect jpa.database=postgresql -jpa.hibernate.ddl-auto=update -jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy jpa.show-sql=false +jpa.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect +jpa.hibernate.ddl-auto=create +jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl diff --git a/src/main/resources/profiles/development/logback.xml b/src/main/resources/profiles/development/logback.xml index 553d025..a4f5e8f 100644 --- a/src/main/resources/profiles/development/logback.xml +++ b/src/main/resources/profiles/development/logback.xml @@ -19,17 +19,17 @@ - + - + \ No newline at end of file diff --git a/src/main/resources/profiles/local/database.properties b/src/main/resources/profiles/local/database.properties index 3593bbb..475c881 100644 --- a/src/main/resources/profiles/local/database.properties +++ b/src/main/resources/profiles/local/database.properties @@ -3,9 +3,8 @@ datasource.username=overflow datasource.password=qwer5795 datasource.driver-class-name=org.postgresql.Driver -jpa.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect jpa.database=postgresql -jpa.hibernate.ddl-auto=create -#jpa.hibernate.ddl-auto=update -jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy jpa.show-sql=false +jpa.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect +jpa.hibernate.ddl-auto=update +jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl diff --git a/src/test/resources/database.properties b/src/test/resources/database.properties index a04336a..4d4fd91 100644 --- a/src/test/resources/database.properties +++ b/src/test/resources/database.properties @@ -3,9 +3,8 @@ datasource.username=overflow datasource.password=qwer5795 datasource.driver-class-name=org.postgresql.Driver -jpa.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect jpa.database=postgresql +jpa.show-sql=false +jpa.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect jpa.hibernate.ddl-auto=create -#jpa.hibernate.ddl-auto=update -jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy -jpa.show-sql=true +jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl