When using queryWriter for pagination queries, the generated CountQuery is different from the Query and returns the error total #3801
Labels
status: waiting-for-triage
An issue we've not yet triaged
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: