org.apache.ws.jaxme.sqls

Interface SelectStatement

All Superinterfaces:
ConstrainedStatement, Statement
Known Subinterfaces:
OraSelectStatement
Known Implementing Classes:
OraSelectStatementImpl, SelectStatementImpl

public interface SelectStatement
extends ConstrainedStatement

Interface of a SELECT statement.
Author:
Jochen Wiedmann

Nested Class Summary

static interface
SelectStatement.OrderColumn
Provides a single column for an ORDER BY clause.

Method Summary

void
addOrderColumn(Object pColumn)
Adds a column to the ORDER BY clause.
void
addOrderColumn(Object pColumn, boolean pDescending)
Adds a column to the ORDER BY clause.
void
addOrderColumn(SelectStatement.OrderColumn pColumn)
Adds a column to the ORDER BY clause.
void
addResultColumn(ColumnReference pColumn)
Adds a result column to the statement.
Table
createView(String pName)
Creates a view, which may be used to embed the statement into a separate query.
Table
createView(Table.Name pName)
Creates a view, which may be used to embed the statement into a separate query.
int
getMaxRows()
Returns the limit of the number of rows in the result set, or zero, if the size of the result set is unlimited.
Iterator
getOrderColumns()
Returns the list of order columns.
Iterator
getResultColumns()
Returns the list of result columns.
SelectTableReference
getSelectTableReference()
Shortcut for (SelectTableReference) getTable().
Iterator
getSelectTableReferences()
Returns an Iterator over all the table references.
int
getSkippedRows()
Returns the number of rows to skip at the result sets beginning.
boolean
isDistinct()
Returns whether the statement should have a DISTINCT clause.
void
setDistinct(boolean pDistinct)
Sets whether the statement should have a DISTINCT clause.
void
setMaxRows(int pMaxRows)
Limits the size of the result set to the given number of rows.
void
setSkippedRows(int pSkippedRows)
Indicates that the given number of rows should be skipped at the result sets beginning.

Methods inherited from interface org.apache.ws.jaxme.sqls.ConstrainedStatement

getWhere

Methods inherited from interface org.apache.ws.jaxme.sqls.Statement

createFunction, getSQLFactory, getTableReference, newCase, setTable

Method Details

addOrderColumn

public void addOrderColumn(Object pColumn)
Adds a column to the ORDER BY clause. The column is sorted in ascending order.

addOrderColumn

public void addOrderColumn(Object pColumn,
                           boolean pDescending)
Adds a column to the ORDER BY clause. The column is sorted in ascending or descending order, depending on the parameter pDescending.
Parameters:
pDescending - True for descending or false for ascending

addOrderColumn

public void addOrderColumn(SelectStatement.OrderColumn pColumn)
Adds a column to the ORDER BY clause.

addResultColumn

public void addResultColumn(ColumnReference pColumn)
Adds a result column to the statement. By default all columns are returned.

createView

public Table createView(String pName)
Creates a view, which may be used to embed the statement into a separate query.

createView

public Table createView(Table.Name pName)
Creates a view, which may be used to embed the statement into a separate query.

getMaxRows

public int getMaxRows()
Returns the limit of the number of rows in the result set, or zero, if the size of the result set is unlimited.

getOrderColumns

public Iterator getOrderColumns()

getResultColumns

public Iterator getResultColumns()
Returns the list of result columns.

getSelectTableReference

public SelectTableReference getSelectTableReference()
Shortcut for (SelectTableReference) getTable().

getSelectTableReferences

public Iterator getSelectTableReferences()
Returns an Iterator over all the table references.

getSkippedRows

public int getSkippedRows()
Returns the number of rows to skip at the result sets beginning. The default is zero, in which case no rows are skipped.

isDistinct

public boolean isDistinct()
Returns whether the statement should have a DISTINCT clause. By default no DISTINCT clause is present.

setDistinct

public void setDistinct(boolean pDistinct)
Sets whether the statement should have a DISTINCT clause. By default no DISTINCT clause is present.

setMaxRows

public void setMaxRows(int pMaxRows)
Limits the size of the result set to the given number of rows. Defaults to zero, in which case the size of the result set is unlimited.

setSkippedRows

public void setSkippedRows(int pSkippedRows)
Indicates that the given number of rows should be skipped at the result sets beginning. The default is zero, in which case no rows are skipped.