This commit is contained in:
crusader 2018-07-16 12:03:57 +09:00
parent 9bde4d74ec
commit fa4826055a
5 changed files with 18 additions and 15 deletions

View File

@ -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);

View File

@ -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

View File

@ -19,17 +19,17 @@
</appender>
<!-- TRACE > DEBUG > INFO > WARN > ERROR -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{32} - %msg%n
</pattern>
</encoder>
</appender>
</appender> -->
<root level="ERROR">
<appender-ref ref="ROLLING" />
<appender-ref ref="STDOUT" />
<!-- <appender-ref ref="STDOUT" /> -->
</root>
<logger name="com.loafle.overflow" level="ALL" />
</configuration>

View File

@ -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

View File

@ -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