-
Notifications
You must be signed in to change notification settings - Fork 1.5k
QueryRewriter
not applied to count queries
#3801
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
Comments
Another aspect to consider is that Hibernate has introduced |
|
QueryRewriter
not applied to count queries
We now use QueryRewriter to post-process count queries as well. Previously, only the actual result query has been processed. Closes #3801
We now use QueryRewriter to post-process count queries as well. Previously, only the actual result query has been processed. Closes #3801
That's fixed and backported into |
We now use QueryRewriter to post-process count queries as well. Previously, only the actual result query has been processed. Closes #3801
We now use QueryRewriter to post-process count queries as well. Previously, only the actual result query has been processed. Closes #3801
If there are any areas that do not comply with the specifications when submitting an issue for the first time, please help me point them out
I use Spring Data REST and Spring Data JPA to complete my project.
When I use QueryRewrite to complete dynamic queries, there is an error in pagination.
My test demo link is as follows:
github Chandler : data-rest-test
From the console, it can be seen that, Query SQLis different from countQuery SQL.
The Query SQL calls rewrite and modifies the where condition, while the countQuery SQL does not change, resulting in a total error
There are 5 records in the database, 2 of which comply with the rule (id>3)

When requesting the parameter size=2, the returned totalElements are 5,
When requesting the parameter size!=2 (eg: 4), The returned totalElements are 2,
Thank you for your reading and assistance
The text was updated successfully, but these errors were encountered: