如何在 spring-boot 中设置 hibernate.format_sql? [英] How to set hibernate.format_sql in spring-boot?

查看:29
本文介绍了如何在 spring-boot 中设置 hibernate.format_sql?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 spring-boot 自动配置进行数据库注入,并定义了属性:

I'm using spring-boot autoconfiguration for database injection, with properties defined:

spring.jpa.database=POSTGRESQL
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=update

但是我如何设置hibernate.format_sql=true?spring boot 不支持吗?

But how can I set the hibernate.format_sql=true? Is that not supported by spring boot?

推荐答案

Spring Boot 将允许您使用以下方法设置任何可用的休眠属性:

Spring Boot will let you set any available hibernate property using:

spring.jpa.properties.*

所以 spring.jpa.properties.hibernate.format_sql=true 也能工作.

查看这个 部分文档

这篇关于如何在 spring-boot 中设置 hibernate.format_sql?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆