Spring Data JPA generates incorrect JPQL query for pagination request #2969
Labels
in: query-parser
Everything related to parsing JPQL or SQL
type: regression
A regression from a previous release
Milestone
Hi
We upgraded our project to Spring Data JPA 3.1 and found new error. We have StoryRepository with method findStories:
And we invoke it in our service:
It worked before upgrade but now we got an exception:
Caused by: org.hibernate.query.sqm.ParsingException: line 1:45 mismatched input '.' expecting {<EOF>, ',', '+', '-', '*', '/', '%', '||', ASC, BY, DAY, DESC, EPOCH, FETCH, HOUR, LIMIT, MINUTE, MONTH, NANOSECOND, NULLS, OFFSET, QUARTER, SECOND, WEEK, YEAR}
Here's JPQL query generated by Spring Data:
FROM Story WHERE enabled = true order by null.created desc
Interesting is that if we change our repository query to
@Query("SELECT p FROM Story p WHERE p.enabled = true")
then everything works correctly.
The text was updated successfully, but these errors were encountered: