How to set hibernate.format_sql in spring-boot?

membersound picture membersound · Sep 8, 2014 · Viewed 46.2k times · Source

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

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

Answer

geoand picture geoand · Sep 8, 2014

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

spring.jpa.properties.*

So spring.jpa.properties.hibernate.format_sql=true would work as well.

Check out this part of the documentation