In moving off of MongoDB there are a few places where the code used to rely on the database to sort the results. Now it sorts the results after fetching them because the CrudRepository has no methods on it that accept a Sort. However, there is a PagingAndSortingRepository subclass of CrudRepository that can accept a Sort.
Find the places where we do the sorting after the fetching and update those repositories to the PagingAndSortingRepository so that we can once again offload the sorting to the database where it belongs.
In moving off of MongoDB there are a few places where the code used to rely on the database to sort the results. Now it sorts the results after fetching them because the
CrudRepository
has no methods on it that accept aSort
. However, there is aPagingAndSortingRepository
subclass ofCrudRepository
that can accept aSort
.Find the places where we do the sorting after the fetching and update those repositories to the
PagingAndSortingRepository
so that we can once again offload the sorting to the database where it belongs.