Closed luic-c closed 1 month ago
It's a breaking change at Spring Boot side https://github.com/spring-projects/spring-boot/commit/4d30eb453f3d033784ca307257ae9436047bb54e
By default, Spring Boot configures the physical naming strategy with
CamelCaseToUnderscoresNamingStrategy
.
Spring Boot will lowercase column name in @Column()
since v2.6.0, so the column name is "id$"
in generated sql but ID$
in table structure, H2 treat quoted name as case sensitive, so there are different columns.
The workaround is changing ID$
to "id$"
in your sql. Or set physical-strategy
to org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
.
Hibernate will quote column name if it contains $
since 6.0.0.Beta2.
Thank you @quaff for looking this up!
Hi, we are currently migrating from Spring Boot 2 to Spring Boot 3 and encountered the syntax error issue with ID$ field when trying to execute the data query function. We would like to know if this issue is expected or not:
It seems the problem lies on the additional quote for the ID$ field. This issue did not happen with Spring Boot 2.7, and trying to set globally_quoted_identifiers_skip_column_definitions=true also did not resolve this issue.
(Although trying to set
hibernate.naming.physical-strategy
toorg.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
did resolve the problem, but since we have other entities so I am not sure if this is the best approach...)Additional info: Spring Boot starter JPA version: 2.7.14 -> 3.2.5 Hibernate version: 5.6.15 final -> 6.4.1 final Original database used: Oracle
demo.zip