jpa hibernate打印控制臺如何格式化輸出SQL語句,hibernate不是有一個屬性嗎:format_sql
spring:
? profiles:
? ? active: dev
? datasource:
? ? driver-class-name: com.mysql.jdbc.Driver
? ? url: jdbc:mysql://127.0.0.1:3306/mybatis
? ? username: root
? ? password: 123456
? jpa:
? ? hibernate:
# ? ? ?ddl-auto: create
? ? ? ddl-auto: update
? ? show-sql: true
? ? format-sql: true
? ? use-sql-comments: true
2018-01-17
https://stackoverflow.com/questions/25720396/how-to-set-hibernate-format-sql-in-spring-boot
spring.jpa.properties.hibernate.format_sql=true
2018-08-31
可以,非常感謝
2018-03-18
試試這個:
2018-02-01
或
或
以上均生效
注意 format_sql中間是下劃線,連字符的寫法format-sql不生效
Console輸出結(jié)果
2017-12-20
?format_sql: true??起作用
2017-12-01
format-sql: true 不起作用其他都能行
2017-11-05
這里的配置不起作用,配置到hibernate屬性下面也不起作用,中間的短線變成下劃線也不起作用,求解