springboot集成jpa打印sql

mac2024-02-18  34

在application.properties中添加:

spring.jpa.show-sql=true spring.jpa.properties.hibernate.format_sql=true

spring.jpa.properties.hibernate.format_sql=true 是格式化,如果不加这句,sql输出为一行,不好看。

最新回复(0)