Interface Orders
public interface Orders
Collection of methods used to specify Orders for
PipelineStage.sortBy(Function) stage.
Get an instance with QueryApi.orders(), that is api.queryApi().orders(). Each method builds
one order. The sortBy function returns a list of these orders, and the rows are sorted by the first
order in the list, then by the next one.
Example:
def qapi = api.queryApi()
def p = qapi.tables().products()
return qapi.source(p, [p.sku(), p.label()])
.sortBy { cols -> [qapi.orders().ascNullsLast(cols.label), qapi.orders().descNullsLast(cols.sku)] }
.stream { it.toList() }
- Since:
- 14.0 - Caribou Lou
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionBuilds an ascending order with null values evaluated as the lowest value.Builds an ascending order with null values evaluated as the highest value.Builds a descending order with null values first.Builds a descending order with null values last.
-
Method Details
-
ascNullsFirst
Builds an ascending order with null values evaluated as the lowest value.- Parameters:
e- the expression on which the order is defined- Returns:
- the built order
- Since:
- 14.0 - Caribou Lou
- See Also:
-
ascNullsLast
Builds an ascending order with null values evaluated as the highest value.- Parameters:
e- the expression on which the order is defined- Returns:
- the built order
- Since:
- 14.0 - Caribou Lou
- See Also:
-
descNullsFirst
Builds a descending order with null values first.- Parameters:
e- the expression on which the order is defined- Returns:
- the built order
- Since:
- 14.0 - Caribou Lou
- See Also:
-
descNullsLast
Builds a descending order with null values last.- Parameters:
e- the expression on which the order is defined- Returns:
- the built order
- Since:
- 14.0 - Caribou Lou
- See Also:
-