Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2204

Spring Data - Redis repository doesn't sort with pageRequest

$
0
0

I am calling repository by id and pageRequest parameters but I cannot manage to sort the result. I call my repository in service layer as follow:

Sort sort = new Sort(Sort.Direction.DESC, "dateTime");PageRequest pageRequest = new PageRequest(0, 10, sort) ;repository.findById(id, pageRequest);

And here is my repository class:

public interface QueryResultRepository extends CrudRepository<QueryResult, String>{    Page<QueryResult> findById(String id, Pageable pageable);}

Entity Class:

@RedisHash("queryresultdataredis")public class QueryResultDataRedis {    @Id    private String id = null;    @Indexed    private String queryId = null;    private String name;

enter image description here


Viewing all articles
Browse latest Browse all 2204

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>