I have a simple query controller that takes query parameters (as Person
dto) and a Pageable
:
@RestController
public class PersonController {
@GetMapping("/persons")
public Object search(org.springframework.data.domain.Pageable pageable, Person form) {
repository.findAll(form, pageable);
}
}
The pageable can take both sort
and page
parameters as follows:
http://localhost:8080/persons?sort=age,desc&page=5
Problem: for the sort, I want to add order hints like NULLS_LAST
or NULLS_FIRST
.
Question: how can I achieve this using query params too?