-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
BadJpqlGrammarException: Line 1:236 token recognition error at: '!'; #2970
Comments
The query parser was meant to seamlessly be swapped into place for Hibernate (HQL) and pure JPA (JPQL). There are no official attempts to "alter" the format of queries. Can you post the precise query so we can build a reproducing test case and properly handle it? |
I can also confirm that Hibernate's own query parser has:
|
Hi @gregturn Thank you for the quick response. You can take any query with "!=", for example,
|
Hibernate also supports "!=" and "^=" as NOT EQUALS operators. See #2970
Merged to |
Looks like this one didn't make into 3.1.1 |
Actually, it's right here: We actually have a parser for HQL (which this ticket addressed) as well as standard JPQL. |
Hi
We tried to upgrade our Spring Boot project and used Spring Data JPA 3.1 (previously we had 3.0.x).
And we received a lot of errors in our JPQL (@query) queries, for example, if we used "!=" operator then we received the following exception trying to execute this query:
Caused by: org.springframework.data.jpa.repository.query.BadJpqlGrammarException: Line 1:236 token recognition error at: '!'; Bad JPQL grammar.
We are aware that JPA officially supports "<>" operator but "!=" also worked before 3.1.
We understood that this issue is caused by new HQL parser in Spring Data JPA however we couldn't find any information about these breaking changes in WIKI: https://github.com/spring-projects/spring-data-commons/wiki/Spring-Data-2023.0-%28Ullman%29-Release-Notes
So what we suggest:
The text was updated successfully, but these errors were encountered: