java.lang.Object
org.litebridge.orm.api.select.model.OrderBySpec
Specification for an "ORDER BY" clause in a database query.
This class allows specifying the expressions to order by and the sort direction (ascending or descending).
-
Constructor Summary
ConstructorsConstructorDescriptionOrderBySpec(List<? extends ExpressionSpec> expressions) Creates a new OrderBySpec with ascending order by default.OrderBySpec(List<? extends ExpressionSpec> expressions, boolean asc) Creates a new OrderBySpec. -
Method Summary
-
Constructor Details
-
OrderBySpec
Creates a new OrderBySpec with ascending order by default.- Parameters:
expressions- the expressions to order by
-
OrderBySpec
Creates a new OrderBySpec.- Parameters:
expressions- the expressions to order byasc- whether to sort in ascending order
-
-
Method Details
-
expressions
Returns the expressions to order by.- Returns:
- the list of expression specifications
-
isAsc
public boolean isAsc()Returns whether the sort order is ascending.- Returns:
trueif ascending,falseif descending
-
setAsc
public void setAsc(boolean asc) Sets whether the sort order should be ascending.- Parameters:
asc-truefor ascending,falsefor descending
-