Skip to content

QueryEnhancerFactory with JSqlParser on classpath prevent using an {h-schema} placeholder in native queries #2564

@valkuc

Description

@valkuc

Hello.
Using Spring Data 2.7.0 (from spring-data-bom version 2021.2.0) and having com.github.jsqlparser in the classpath prevent application to start if repositories use native queries with hibernate placeholders like h-schema. It failing early with net.sf.jsqlparser.JSQLParserException: Encountered unexpected token: "{" "{".
I did not find ability to turn off that feature. The decision to use JSqlParserQueryEnhancer instead of DefaultQueryEnhancer is made in static way in QueryEnhancerFactory.

My project is based on Spring Boot 2.6.8 and in order to mitigate this issue I had switched from shipped spring-data-bom version 2021.1.4 to 2021.2.0. This solved mentioned critical issue but introduced new one :(

Here is test project to help reproduce that issue. Just run CountryRepositoryTest.
Thanks in advance.

Metadata

Metadata

Assignees

Labels

status: declinedA suggestion or change that we don't feel we should currently apply

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions