|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.amrhassan.sqlbuilder.SelectSqlStatement
public final class SelectSqlStatement
A SELECT SQL statement
| Nested Class Summary | |
|---|---|
static class |
SelectSqlStatement.Order
The order specified in an ORDER BY clause |
| Constructor Summary | |
|---|---|
SelectSqlStatement()
|
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SelectSqlStatement()
| Method Detail |
|---|
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 aliases
public 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)public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||