For arranging the objects inside the result set in a special order, Signsoft intelliBO offers the ability to sort query result sets. The definition of the sort criteria is done using the setOrdering() method on the query.
Basically every attribute of a class can be used as an order criterion. You can also sort the query result set by multiple criteria.
If necessary, you have to provide the sort indicator (ascending or descending):
| Indicator | Meaning |
|---|---|
| ascending | sort ascending (A, B, C, ...) |
| descending | sort descending (Z, Y, X, ...) |
This code shows how to use indicators:
// sort ascending by key
query.setOrdering("key descending");
// sort ascending by last name and first name
query.setOrdering("lastName ascending, firstName ascending";