org.enableit.db
Class DBQuery
java.lang.Object
|
+--org.enableit.db.DBStatement
|
+--org.enableit.db.DBQuery
- public class DBQuery
- extends DBStatement
- Author:
- Tim Stephenson
Field Summary |
static java.lang.String |
ABOUT
CVS info about current version of this class. |
Constructor Summary |
DBQuery()
Default constructor. |
DBQuery(java.lang.String sql)
Construct instance and set the SQL. |
DBQuery(java.lang.String newBaseSql,
java.lang.String newOrderBy)
Construct instance and set both the baseSql and orderBy phrases of
a SQL statement. |
DBQuery(java.lang.String newSelectClause,
java.lang.String newFromClause,
java.lang.String newOrderBy)
Constructor that trusts the caller to set up the clauses correctly. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ABOUT
public static final java.lang.String ABOUT
- CVS info about current version of this class.
- See Also:
- Constant Field Values
DBQuery
public DBQuery()
- Default constructor.
DBQuery
public DBQuery(java.lang.String sql)
- Construct instance and set the SQL.
- Parameters:
sql
- A SQL statement, optionally containing GROUP BY and / or
ORDER BY clauses. The GROUP BY should preceed any
ORDER BY.
DBQuery
public DBQuery(java.lang.String newSelectClause,
java.lang.String newFromClause,
java.lang.String newOrderBy)
- Constructor that trusts the caller to set up the clauses correctly.
- Parameters:
newSelectClause
- Specifies the new SELECT clause.newFromClause
- Specifies the new FROM clause.newOrderBy
- Specifies the new ORDER BY clause,
actually includes anything after WHERE clause (e.g. GROUP BY).
DBQuery
public DBQuery(java.lang.String newBaseSql,
java.lang.String newOrderBy)
- Construct instance and set both the baseSql and orderBy phrases of
a SQL statement.
- Parameters:
newBaseSql
- The base SQL statement (not including group or order by).newOrderBy
- The remainder of the SQL statement.
getBaseSql
public java.lang.String getBaseSql()
- Overrides:
getBaseSql
in class DBStatement
- Returns:
- baseSql The base SQL.
setBaseSql
public void setBaseSql(java.lang.String baseSql)
- Overrides:
setBaseSql
in class DBStatement
- Parameters:
baseSql
- The base SQL.
setOrderBy
public void setOrderBy(java.lang.String orderBy)
- Parameters:
orderBy
- The ORDER BY clause.
getSql
public java.lang.String getSql()
- Overrides:
getSql
in class DBStatement
- Returns:
- SQL with placeholders for any parameters.
addJoin
public void addJoin(org.enableit.db.beans.ForeignKey fk)
- Parameters:
fk
- Encapsulates information on what to join to.
Copyright © 1999-2004 enableIT.org. All Rights Reserved.