Hi I appear to have encountered a regression in Hibernate 6. I originally raised this as a stackoverflow at https://stackoverflow.com/questions/76616777/hibernate-6-upgrade-error-syntax-error-at-or-near but further research and feedback on the post it doesn’t appear to be a configuration or logic error in the project, nor does there seem to be a way to configure it. It seems that Hibernate 6 is generating invalid syntax SQL (which it wasn't in hibernate 5) for postgress like queries. Here's the exception:
The Repository Code:
Entity class - note same error occurs with and without @JdbcTypeCode(SqlTypes.LONGVARCHAR) annotation.
From what I understand Spring Boot should auto-configure dialect and database type so it should be generating correctly. However even when manually setting the PostgreSQLDialect dialect it still fails. This query works in Hibernate 5/Spring Boot 2.7. From manually running the query it should be escaping the slash in {{escape \ }}but can't see how to configure this. Other queries such as findAll with a Specification work correctly. Thanks for your help. |