springboot_+jpa 控制台输出sql
转自:链接
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
这样配置之后才起作用。
解决了我jpa自动新增字段出错,但控制台没有sql语句的问题
控制台语句:
alter table platform_course
add constraint FKi6can0owrf8a4mnhp9vh15wan
foreign key (sub_platform_id)
references platform_subplatform (id)
SpringBoot与JPA控制台SQL显示

本文解决了一个常见的SpringBoot与JPA开发中遇到的问题:如何在控制台显示SQL语句。通过配置spring.jpa.show-sql和spring.jpa.properties.hibernate.format_sql参数为true,可以实现在控制台查看格式化的SQL语句,便于开发调试。
2660

被折叠的 条评论
为什么被折叠?



