Class OrderBySpec

java.lang.Object
org.litebridge.orm.api.select.model.OrderBySpec

public class OrderBySpec extends Object
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 Details

    • OrderBySpec

      public OrderBySpec(List<? extends ExpressionSpec> expressions)
      Creates a new OrderBySpec with ascending order by default.
      Parameters:
      expressions - the expressions to order by
    • OrderBySpec

      public OrderBySpec(List<? extends ExpressionSpec> expressions, boolean asc)
      Creates a new OrderBySpec.
      Parameters:
      expressions - the expressions to order by
      asc - whether to sort in ascending order
  • Method Details

    • expressions

      public List<ExpressionSpec> 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:
      true if ascending, false if descending
    • setAsc

      public void setAsc(boolean asc)
      Sets whether the sort order should be ascending.
      Parameters:
      asc - true for ascending, false for descending