public final class QueryOrder extends QueryPart
The ORDER BY clause of a Select; renders nothing when it has no fields.
  • Constructor Details

    • QueryOrder

      public QueryOrder()
  • Method Details

    • isEmpty

      public boolean isEmpty()
    • isNotEmpty

      public boolean isNotEmpty()
    • clear

      public QueryOrder clear()
    • add

      public QueryOrder add(String... fields)
      Appends the fields in ascending order.
    • add

      public QueryOrder add(FieldList fields)
      Appends the fields in ascending order; null is ignored.
    • add

      public QueryOrder add(String field, boolean ascending)
    • add

      public QueryOrder add(String field, boolean ascending, Boolean nullsFirst)
      Appends a field in the given order, adding NULLS FIRST or NULLS LAST unless nullsFirst is null.
    • getParts

      public List<QueryOrderPart> getParts()
    • collectSqlFragment

      public void collectSqlFragment(CodeWriter writer)
      Description copied from class: SqlPart
      Writes this part's SQL to the writer; used by SqlPart.getSqlFragment() and by enclosing parts.
      Specified by:
      collectSqlFragment in class SqlPart
    • collectParameterValues

      public void collectParameterValues(List<Object> values)
      Description copied from class: SqlPart
      Appends the values for this part's ? parameters to the list in order; adds nothing by default.
      Overrides:
      collectParameterValues in class SqlPart