我使用spring-boot
自动配置进行数据库注入,并定义了属性:
spring.jpa.database=POSTGRESQL
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=update
但是我如何设置hibernate.format_sql=true
呢?spring boot不支持这一点吗?
发布于 2014-09-08 16:58:43
Spring Boot将允许您使用以下命令设置任何可用的hibernate属性:
spring.jpa.properties.*
所以spring.jpa.properties.hibernate.format_sql=true
也可以工作。
查看文档的this部分
发布于 2017-02-25 22:41:39
如果使用yml
格式声明Spring Boot属性,则可以使用:
spring:
datasource:
jpa:
properties:
hibernate.format_sql: true
发布于 2017-04-12 15:20:58
jpa:
hibernate:
ddl-auto: update
show-sql: true
properties:
hibernate.format_sql: true
https://stackoverflow.com/questions/25720396
复制相似问题