Package com.exasol.sql.dql.select
Class OrderByClause
- java.lang.Object
-
- com.exasol.sql.AbstractFragment
-
- com.exasol.sql.dql.select.OrderByClause
-
- All Implemented Interfaces:
SelectFragment,Fragment
public class OrderByClause extends AbstractFragment implements SelectFragment
This class represents theORDER BYclause of an SQL statement.
-
-
Field Summary
-
Fields inherited from class com.exasol.sql.AbstractFragment
root
-
-
Constructor Summary
Constructors Constructor Description OrderByClause(SqlStatement rootStatement, ColumnReference... columnReferences)Create a new instance of aOrderByClause.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(SelectVisitor visitor)Accept a visitor (e.g.OrderByClauseasc()Add ASC option to theOrderByClauseOrderByClausedesc()Add DESC option to theOrderByClauseList<ColumnReference>getColumnReferences()Get list of column references.BooleangetDesc()Get descending.BooleangetNullsFirst()Get nulls first.OrderByClausenullsFirst()Add NULLS FIRST option to theOrderByClauseOrderByClausenullsLast()Add NULLS LAST option to theOrderByClause-
Methods inherited from class com.exasol.sql.AbstractFragment
getRoot
-
-
-
-
Constructor Detail
-
OrderByClause
public OrderByClause(SqlStatement rootStatement, ColumnReference... columnReferences)
Create a new instance of aOrderByClause.- Parameters:
rootStatement- SQL statement thisORDER BYclause belongs tocolumnReferences- column references for theORDER BYclause
-
-
Method Detail
-
accept
public void accept(SelectVisitor visitor)
Description copied from interface:SelectFragmentAccept a visitor (e.g. a renderer or validator)- Specified by:
acceptin interfaceSelectFragment- Parameters:
visitor- visitor to accept
-
getColumnReferences
public List<ColumnReference> getColumnReferences()
Get list of column references.- Returns:
- column name
-
desc
public OrderByClause desc()
Add DESC option to theOrderByClause- Returns:
- instance of
OrderByClausefor fluent programming
-
asc
public OrderByClause asc()
Add ASC option to theOrderByClause- Returns:
- instance of
OrderByClausefor fluent programming
-
getDesc
public Boolean getDesc()
Get descending.- Returns:
- true if descending
-
nullsFirst
public OrderByClause nullsFirst()
Add NULLS FIRST option to theOrderByClause- Returns:
- instance of
OrderByClausefor fluent programming
-
nullsLast
public OrderByClause nullsLast()
Add NULLS LAST option to theOrderByClause- Returns:
- instance of
OrderByClausefor fluent programming
-
getNullsFirst
public Boolean getNullsFirst()
Get nulls first.- Returns:
- true if nulls first
-
-