Spring-boot: hibernate5 naming-strategy

Created on 1 Jul 2016  路  2Comments  路  Source: spring-projects/spring-boot

like this issue

https://github.com/spring-projects/spring-boot/issues/2129

spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.DefaultNamingStrategy
it sames work for spring boot 1.3.3
but not work for spring boot 1.4.0.BUILD-SNAPSHOT

while spring boot ref hibernate's version is 5.0.9

there is no spring.jpa.hibernate.naming-strategy
but has
spring.jpa.hibernate.naming.implicit-strategy and spring.jpa.hibernate.naming.physical-strategy

how can i do to make it works like DefaultNamingStrategy?

stackoverflow

Most helpful comment

hibernate4.0

spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.DefaultNamingStrategy

hibernate5.0

#spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl

it works for me

All 2 comments

This has nothing to do with Spring Boot, really. Hibernate 5 has changed to two separated interfaces for their naming strategy infrastructure. We're just following along. Note also they broke the naming strategy between Hibernate 4 and Hibernate 5 so if you were relying on org.hibernate.cfg.DefaultNamingStrategy, I am not sure there is a strict equivalent in Hibernate 5.

Either way, this is a question to ask on the Hibernate forum (probably stackoverflow).

hibernate4.0

spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.DefaultNamingStrategy

hibernate5.0

#spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl

it works for me

Was this page helpful?
0 / 5 - 0 ratings