samedi 3 novembre 2018

Spring pageSize returns too many items

Spring pageSize returns too many items - 1+, does not work:

{
"offset": 0,
"pageNumber": 1,
"pageSize": 1,
"sort": null
}

Repository

@Query(value = "SELECT * from products AS p "//...
        nativeQuery = true)
Page<Product> findByRandomCategoryIds(final Pageable pageable);

Controller

@GetMapping(path = "/categories")
public Page<Product> readByRandomCategories(Pageable pageable) {
    return repository.findByRandomCategoryIds(pageable);
}

How to fix this?




Aucun commentaire:

Enregistrer un commentaire