DATAREDIS-551 - Fix pageable query execution when derived criteria is empty.
We now make sure to count records without using criteria when derived criteria is empty. This allows usage of declared query methods using `Pageable` without criteria like `findBy(Pageable page)`. Original Pull Request: #220
This commit is contained in:
committed by
Christoph Strobl
parent
a8462c597e
commit
5aef8c3b0b
@@ -40,6 +40,7 @@ import org.springframework.util.CollectionUtils;
|
||||
* Redis specific {@link QueryEngine} implementation.
|
||||
*
|
||||
* @author Christoph Strobl
|
||||
* @author Mark Paluch
|
||||
* @since 1.7
|
||||
*/
|
||||
class RedisQueryEngine extends QueryEngine<RedisKeyValueAdapter, RedisOperationChain, Comparator<?>> {
|
||||
@@ -156,6 +157,10 @@ class RedisQueryEngine extends QueryEngine<RedisKeyValueAdapter, RedisOperationC
|
||||
@Override
|
||||
public long count(final RedisOperationChain criteria, final Serializable keyspace) {
|
||||
|
||||
if(criteria == null) {
|
||||
return this.getAdapter().count(keyspace);
|
||||
}
|
||||
|
||||
return this.getAdapter().execute(new RedisCallback<Long>() {
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user