I use mybatis for retriving data from the DB. But I would use the Pageable object (from spring) to have the pagination functionalities. Is this possible? It is still enough to extend myMapper with a PaginationAndSortRepository?
Example:
@Mapper
public interface MyObjetcMapper extends PagingAndSortingRepository {
List<MyObjetc> findAllMyObjetcs(Pageable pageable);
}
and then I use it from my service:
List<MyObjetc> myObjetc= myObjetcMapper.findAllCharacteristics(pageable);
return new PageImpl<>(characteristics, new PageRequest(pageable.getPageNumber(), pageable.getPageSize(), pageable.getSort()), MyObjetc.size());
The problem is that so I will return all MyObjects and not only the requested set.... I have to extract the interested list every time?