You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all,
I have create a specification for querying my database, I would like to set the precedence of null ordering, I create a pageable with custom sort :
Pageable customPageable = pageable;
for (Order sort : pageable.getSort()) {
if (sort.getProperty().equals("column")) {
List<Sort.Order> orderList = new ArrayList<>();
if (sort.isAscending()) {
orderList.add(new Sort.Order(Sort.Direction.ASC,
"column", NullHandling.NULLS_FIRST));
} else {
orderList.add(new Sort.Order(Sort.Direction.DESC,
"column", NullHandling.NULLS_LAST));
}
customPageable = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by(orderList));
}
}
Hi all,
I have create a specification for querying my database, I would like to set the precedence of null ordering, I create a pageable with custom sort :
Pageable customPageable = pageable;
repository.findAll(new Specification(), customPageable);
And when the request is execute on postgres database, only ASC or DESC is readable inside the log file.
i do it wrong, this is a missing functionnality or a bug ?
The text was updated successfully, but these errors were encountered: