code: public org.grails.datastore.mapping.query.api.Criteria order(String propertyName, String direction) {
          if (criteria == null) {
              throwRuntimeException(new IllegalArgumentException("Call to [order] with propertyName [" +
                      propertyName + "]not allowed here."));
          }
          propertyName = calculatePropertyName(propertyName);
          Order o;
          if (direction.equals(ORDER_DESCENDING)) {
              o = Order.desc(propertyName);
          }
          else {
              o = Order.asc(propertyName);
          }
          if (paginationEnabledList) {
              orderEntries.add(o);
          }
          else {
              criteria.addOrder(o);
          }
          return this;
      }
docs: Orders by the specified property name and direction
  
  @param propertyName The property name to order by
  @param direction Either "asc" for ascending or "desc" for descending
  
  @return A Order instance