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 ; }
Orders by the specified property name and direction