code: private static void addOrder(Criteria c, String sort, String order, boolean ignoreCase) {
          if (ORDER_DESC.equals(order)) {
              c.addOrder(ignoreCase ? Order.desc(sort).ignoreCase() : Order.desc(sort));
          }
          else {
              c.addOrder(ignoreCase ? Order.asc(sort).ignoreCase() : Order.asc(sort));
          }
      }
docs: Add order directly to criteria.