I am using spring data jpa and JQGrid. I need response based on multiple sort parameters. I tried using sort parameter=column a,column b and sort order=asc but I am getting an exception
:No property column a,column b found in pojo.
It works if I would pass either of one columns as sort parameter. Code:
Pageable pageable = JPAUtility.constructPageSpecification(pageNumber, rowsPerPage, sortColName, sortOrder);
How can I pass multiple column names in sortColName
parameter?
In Spring Data you just need to add Sort parameter into findBy* method. Sort object has got a couple constructors, e.g.
which is probably exactly what you need. If you need to specify different directions for various properties then you can use
where Order has property and direction:
Order(Direction direction, String property)