I have a PagingandSorting Repository which has a method that accecpts a pageable object. I also have a controller that accepts a pageable object through the URL.
My
You can use this Annotation before your Pageable param:
@PageableDefault(size = 40)
// so your parameter should be like this:
@PageableDefault(size = 40) Pageable pageable
** Update: You can store 40 in application.yml file and use it in the whole project.
in application.yml :
pageSize: 40
then:
// so your parameter should be like this:
@PageableDefault(size = ${pageSize}) Pageable pageable