IDEA控制台打印SQL如何正确换行?
在IDEA中使用JPA时设置了show-sql
: true
打印出的sql是类似这样密集的一行:
update table set name=?, length_type=?, list_order=?, name=?, type=?, uptime=? where id=?
我看到网上很多都是这样换行显示的:
select
id,name
from
table
where
...
join
...
我也想显示成这种换行的,请问该如何设置?
回复
1个回答

test
2024-07-18
application.properties:
spring.jpa.properties.hibernate.format_sql=true
application.yml:
spring:
jpa:
properties:
hibernate:
format_sql: true
回复

适合作为回答的
- 经过验证的有效解决办法
- 自己的经验指引,对解决问题有帮助
- 遵循 Markdown 语法排版,代码语义正确
不该作为回答的
- 询问内容细节或回复楼层
- 与题目无关的内容
- “赞”“顶”“同问”“看手册”“解决了没”等毫无意义的内容