public OrderCriteria buildOrderCriteria() { if (orderCriteria == null) { return defaultOrderCriteria; } OrderCriteria result = new OrderCriteria(); String[] orders = orderCriteria.split(","); for (String order : orders) { String[] orderInfo = order.split(":"); result.addOrder(new Order(orderInfo[0], orderInfo[1])); } return result; }
static { defaultOrderCriteria.addOrder(new Order("id", Sequence.DESC)); }