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 BY
clause 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 void
accept(SelectVisitor visitor)
Accept a visitor (e.g.OrderByClause
asc()
Add ASC option to theOrderByClause
OrderByClause
desc()
Add DESC option to theOrderByClause
List<ColumnReference>
getColumnReferences()
Get list of column references.Boolean
getDesc()
Get descending.Boolean
getNullsFirst()
Get nulls first.OrderByClause
nullsFirst()
Add NULLS FIRST option to theOrderByClause
OrderByClause
nullsLast()
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 BY
clause belongs tocolumnReferences
- column references for theORDER BY
clause
-
-
Method Detail
-
accept
public void accept(SelectVisitor visitor)
Description copied from interface:SelectFragment
Accept a visitor (e.g. a renderer or validator)- Specified by:
accept
in 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
OrderByClause
for fluent programming
-
asc
public OrderByClause asc()
Add ASC option to theOrderByClause
- Returns:
- instance of
OrderByClause
for 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
OrderByClause
for fluent programming
-
nullsLast
public OrderByClause nullsLast()
Add NULLS LAST option to theOrderByClause
- Returns:
- instance of
OrderByClause
for fluent programming
-
getNullsFirst
public Boolean getNullsFirst()
Get nulls first.- Returns:
- true if nulls first
-
-