Skip to content

Sqlparser prohibits the use of syntax regulated by JPA (function cast) #3863

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
DmitryBelousov1992 opened this issue Apr 30, 2025 · 0 comments
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@DmitryBelousov1992
Copy link

DmitryBelousov1992 commented Apr 30, 2025

Attached you will find a reproducer that implements a sample application with JPA Entity "Item" containing field "date" and corresponding repository ItemRepository.
The repository contains only one method with query select "select i from Item i where cast(i.date as date) <= cast(:currentDateTime as date)".
Running this app leads to error

Caused by: org.springframework.data.jpa.repository.query.BadJpqlGrammarException: At 1:39 and token 'as', no viable alternative at input 'select i from Item i where cast(i.date *as date) <= cast(:currentDateTime as date)'; Bad EQL grammar [select i from Item i where cast(i.date as date) <= cast(:currentDateTime as date)]

'org.springframework.boot' version '3.4.5'

EQLParseError.zip

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

2 participants