* 单条件排序
*/
//id升序查询
Sort sort = new Sort(Sort.Direction.ASC,"id");
return userDao.findUserLikeBySort(sort);

/**
* 多条件排序
*/
List<Order> orders=new ArrayList<Order>();
Order orderId = new Sort.Order(Sort.Direction.DESC,"id");
Order orderAge = new Sort.Order(Sort.Direction.DESC,"age");
orders.add(orderId);
orders.add(orderAge);
Sort sort = new Sort(orders);
return userDao.findUserLikeBySort(sort);
Last modification:February 13th, 2020 at 03:42 pm
如果觉得我的文章对你有用,请随意赞赏