I am coding a Spring Boot system which connects to the database. While implementing functions that change the state of the entity, I faced the following problem:
'PageRequest(int, int, org.springframework.data.domain.Sort)' has protected access in 'org.springframework.data.domain.PageRequest'
in this:
@Override
public List<Picture> getAllPictures(int pageNumber, int pageSize) {
return pictureRepository.findAll(new PageRequest(pageNumber, pageSize)).getContent();
}
How can I solve it? Is it something else that is similar to PageRequest
and could replace it?