I have an application which shows some comments. Now I want to sort the comments by create time asc, but I want to show the latest comments as default.
I do it like this:
public Page<Comment> getComments(@PageableDefault(value = 15, sort = { "createdTime" }, direction = Sort.Direction.ASC)
Pageable pageable) {
return commentRepository.findAll(pageable);
}
Now I can only get the first page as default, what shall I do to get the last page as default?