|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.torque.sql.Query
public class Query
Contains the various parts of a SQL statement (select, update or delete). Attributes exist for the sections of these statements: modifiers, columns, from clause, where clause, and order by clause. Most parts of the query are appended to buffers which only accept unique entries.
Nested Class Summary | |
---|---|
static class |
Query.Type
All types of the statement. |
Constructor Summary | |
---|---|
Query()
|
Method Summary | |
---|---|
String |
getDisplayString()
Returns a String to display this query. |
Integer |
getFetchSize()
Returns the JDBC statement fetch size to use for queries. |
String |
getForUpdate()
Returns the FOR UPDATE clause which should be added to the query. |
UniqueList<FromElement> |
getFromClause()
Retrieve the from buffer in order to specify which tables are involved in this query. |
UniqueList<String> |
getGroupByClause()
Retrieve the group by columns buffer in order to specify which columns are used to group the results of the query. |
String |
getHaving()
Get the having clause. |
String |
getLimit()
Get the limit number. |
String |
getOffset()
Get the offset number. |
UniqueList<String> |
getOrderByClause()
Retrieve the order by columns buffer in order to specify which columns are used to sort the results of the query. |
String |
getPostLimit()
Get the Post limit String. |
String |
getPreLimit()
Get the Pre limit String. |
List<Object> |
getPreparedStatementReplacements()
Returns all preparedStatementReplacements in the query. |
String |
getRowcount()
Get the rowcount number. |
UniqueList<String> |
getSelectClause()
Retrieve the columns buffer in order to specify which columns are returned in this query. |
UniqueList<String> |
getSelectModifiers()
Retrieve the modifier buffer in order to add modifiers to this query. |
Query.Type |
getType()
Returns the type of this SQL statement. |
UniqueList<String> |
getWhereClause()
Retrieve the where buffer in order to specify the selection criteria E.g. |
List<Object> |
getWhereClausePreparedStatementReplacements()
Retrieves the replacements which are inserted into prepared statement placeholders in the where clause. |
boolean |
hasLimit()
True if this query has a limit clause registered. |
void |
setFetchSize(Integer fetchSize)
Sets the JDBC statement fetch size to use for queries. |
void |
setForUpdate(String forUpdate)
Sets the FOR UPDATE clause which should be added to the query. |
void |
setHaving(String having)
Set the having clause. |
void |
setLimit(String limit)
Set the limit number. |
void |
setOffset(String offset)
Set the offset number. |
void |
setPostLimit(String postLimit)
Set the Post limit String. |
void |
setPreLimit(String preLimit)
Get the Pre limit String. |
void |
setRowcount(String rowcount)
Set the rowcount number. |
void |
setType(Query.Type type)
Sets the type of this SQL statement. |
String |
toString()
Outputs the query statement. |
StringBuilder |
toStringBuilder(StringBuilder stringBuilder)
Appends the query to a string builder. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Query()
Method Detail |
---|
public UniqueList<String> getSelectModifiers()
public UniqueList<String> getSelectClause()
public UniqueList<FromElement> getFromClause()
public UniqueList<String> getWhereClause()
public List<Object> getWhereClausePreparedStatementReplacements()
public List<Object> getPreparedStatementReplacements()
public UniqueList<String> getOrderByClause()
public UniqueList<String> getGroupByClause()
public String getHaving()
public void setHaving(String having)
having
- A String.public String getLimit()
public void setLimit(String limit)
limit
- A String.public String getPreLimit()
public void setPreLimit(String preLimit)
preLimit
- A String with the preLimit.public String getPostLimit()
public void setPostLimit(String postLimit)
postLimit
- A String with the postLimit.public String getOffset()
public void setOffset(String offset)
offset
- A String.public String getRowcount()
public void setRowcount(String rowcount)
rowcount
- A String.public void setForUpdate(String forUpdate)
forUpdate
- the FOR UPDATE clause which should be added,
null if no FOR UPDATE clause should be used.public String getForUpdate()
public boolean hasLimit()
public Query.Type getType()
public void setType(Query.Type type)
type
- the new type, not null.
NullPointerException
- if type
is null.public Integer getFetchSize()
public void setFetchSize(Integer fetchSize)
fetchSize
- the fetch size, or null for not set.public String toString()
toString
in class Object
public StringBuilder toStringBuilder(StringBuilder stringBuilder)
stringBuilder
- the stringBuilder to append to, not null.
public String getDisplayString() throws TorqueException
TorqueException
- Trouble creating the query string.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |