spring-batch
spring-batch copied to clipboard
boolean remainingPageQuery=true flag in SqlPagingQueryUtils adds sortKeys to whereClause
Bug description
generateLimitQuery() method in SqlPagingQueryUtils calls buildWhereClause() method when remainingPageQuery=true and adds
sortKeys to where clause, why so?
I have sortKeys, say
name ascending, age ascending
and where clause has two fields (name and age) which i will pass during program execution.
So technically the sql should be
select * from table1 where name=:name and age=:age order by name asc, age asc
but query built is
select * from table1 where name=:name and age=:age and ((name > :_name) or (age >:_age)) order by name asc, age asc
In above case, I dont want this extra conditions in where clause for added sortKeys.
Environment spring-batch-infrastructure-4.3.6 java version 17 database using is DB2
Steps to reproduce
Expected behavior I dont want extra conditions in where clause than given ones as I am not passing any values for sortKeys except the ordering sequence.
Minimal Complete Reproducible example