public final class SelectSqlStatement extends Object implements SqlStatement
| Modifier and Type | Class and Description |
|---|---|
static class |
SelectSqlStatement.Order
The order specified in an ORDER BY clause
|
| Constructor and Description |
|---|
SelectSqlStatement() |
| Modifier and Type | Method and Description |
|---|---|
void |
addFieldAs(String name,
String alias)
Add a field to be selected.
|
void |
addFields(String... names)
Add a fields to be selected.
|
void |
addGroupByFields(String... fields)
Add a field to be used for the GROUP BY clause
|
void |
addOrderBy(SelectSqlStatement.Order order,
String... fields)
Specify a field to be used for the ORDER BY clause
|
void |
addOrderBy(String... fields)
Specify fields to be used for the ORDER BY clause
|
void |
addSource(SqlSource source)
Add a source for the statement, which can be a simple table name
or a complex JOIN clause (see
SqlSources) |
void |
disableDistinct()
Disable the DISTINCT clause
|
void |
enableDistinct()
Enable the DISTINCT clause
|
void |
setRestriction(SqlRestriction restriction)
The restrictions used in the WHERE clause
|
String |
toString() |
public void enableDistinct()
public void disableDistinct()
public void addSource(SqlSource source)
SqlSources)public void addFieldAs(String name, String alias)
name - Column name or aggregate function expressionalias - An alias for the specified field namepublic void addFields(String... names)
names - Column names or aggregate function expressionpublic void addOrderBy(String... fields)
fields - The field names or their aliases if they were specified with aliasespublic void addOrderBy(SelectSqlStatement.Order order, String... fields)
fields - The field names or their aliases if they were specified with aliasesorder - The order of the rowspublic void addGroupByFields(String... fields)
field - The field name or its alias if it was specified with an aliaspublic void setRestriction(SqlRestriction restriction)
restriction - (See SqlSources)Copyright © 2013. All Rights Reserved.