Is there a way to map properties of Sort objects? Just a little example:
a Dto
public class OrderDto {
private long totalAmount;
private long openAmount;
}
and an entity
@Entity
public class Order {
private long amount;
}
and a controller
@RestController
public class OrderController {
@GetMapping("/orders")
public Page<OrderDto> findOrders(Pageable pageable) {
// Do something
}
}
I would now call /orders?sort=totalAmount,desc
Is it possible to map the sort property, in this case the totalAmount
from the Dto to only amount
to use this for a generated JPA query in a charmant way?