I want to use Spring Data JPA with default sort direction with the latest spring-boot-starter-parent 2.2.1.RELEASE:
@Override
public Page<ProcessingLogs> findAll(int page, int size) {
return dao.findAll(PageRequest.of(page,size, new Sort(Sort.Direction.DESC, "createdAt")));
}
But I get error:
The constructor Sort(Sort.Direction, String) is undefined
This is the latest code: https://github.com/spring-projects/spring-data-commons/blob/master/src/main/java/org/springframework/data/domain/Sort.java
Do you know how I can solve this issue?
Sort.by(Sort.Direction.DESC, "createdAt");
.new Sort
toSort.by