|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.db.sql.Query
public abstract class Query
| Field Summary | |
|---|---|
protected Expr |
_whereExpr
|
| Constructor Summary | |
|---|---|
protected |
Query(Database db,
java.lang.String sql)
|
protected |
Query(Database db,
java.lang.String sql,
com.caucho.db.sql.FromItem[] fromItems)
|
| Method Summary | |
|---|---|
protected void |
bind()
Binds the query. |
protected Expr |
bind(java.lang.String tableName,
java.lang.String columnName)
Returns a bound expression for the specified table.column. |
void |
clearParameters()
Clears the paramters. |
abstract void |
execute(QueryContext queryCtx,
Transaction xa)
Executes the query. |
protected void |
freeRows(TableIterator[] rows,
int rowLength)
Frees any blocks for the rows. |
protected void |
generateWhere(Expr whereExpr)
Optimize the where and order the from items. |
Database |
getDatabase()
Returns the owning database. |
int |
getDataFields()
Returns the number of temporary data fields. |
com.caucho.db.sql.FromItem[] |
getFromItems()
Returns any from items. |
java.util.ArrayList<com.caucho.db.sql.SubSelectParamExpr> |
getParamExprs()
Returns the param exprs. |
Query |
getParent()
Gets the parent query |
SubSelectExpr |
getSubSelect()
Gets the parent sub-select. |
Expr[] |
getWhereExprs()
Returns the where exprs |
boolean |
isGroup()
Sets true for group operations |
boolean |
isReadOnly()
|
boolean |
isSelect()
Returns true for select queries. |
protected boolean |
nextTuple(TableIterator[] rows,
int rowLength,
QueryContext queryContext,
Transaction xa)
Returns the next tuple from the query. |
void |
setBinaryStream(int index,
java.io.InputStream is,
int length)
Sets the indexed parameter as a binary stream |
void |
setBoolean(int index,
boolean value)
Sets the indexed parameter as a boolean. |
void |
setBytes(int index,
byte[] bytes)
Sets the indexed parameter as a bytes |
void |
setDataFields(int fieldCount)
Sets the number of temporary data fields. |
void |
setDate(int index,
long value)
Sets the indexed parameter as a date value. |
void |
setDouble(int index,
double value)
Sets the indexed parameter as a double. |
protected void |
setFromItems(java.util.ArrayList<com.caucho.db.sql.FromItem> fromItems)
Sets from items. |
protected void |
setFromItems(com.caucho.db.sql.FromItem[] fromItems)
Sets from items. |
void |
setGroup(boolean isGroup)
Sets the current number of group fields. |
void |
setLimit(int limit)
Sets the maximum entires |
void |
setLong(int index,
long value)
Sets the indexed parameter as a long. |
void |
setParams(com.caucho.db.sql.ParamExpr[] params)
Sets the params. |
void |
setParent(Query query)
Sets the parent query |
void |
setString(int index,
java.lang.String value)
Sets the indexed parameter as a string. |
void |
setSubSelect(SubSelectExpr subSelect)
Sets the parent sub-select. |
void |
setWhereExpr(Expr expr)
Sets the where expr. |
protected void |
setWhereExprs(Expr[] whereExprs)
Sets the where exprs. |
protected boolean |
start(TableIterator[] rows,
int rowLength,
QueryContext queryContext,
Transaction xa)
Starts the query. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Expr _whereExpr
| Constructor Detail |
|---|
protected Query(Database db,
java.lang.String sql)
protected Query(Database db,
java.lang.String sql,
com.caucho.db.sql.FromItem[] fromItems)
| Method Detail |
|---|
public Database getDatabase()
public void setParent(Query query)
public Query getParent()
public void setSubSelect(SubSelectExpr subSelect)
public SubSelectExpr getSubSelect()
public int getDataFields()
public void setDataFields(int fieldCount)
public void setLimit(int limit)
public com.caucho.db.sql.FromItem[] getFromItems()
protected void setFromItems(com.caucho.db.sql.FromItem[] fromItems)
protected void setFromItems(java.util.ArrayList<com.caucho.db.sql.FromItem> fromItems)
public void setWhereExpr(Expr expr)
public Expr[] getWhereExprs()
protected void setWhereExprs(Expr[] whereExprs)
public void setParams(com.caucho.db.sql.ParamExpr[] params)
public java.util.ArrayList<com.caucho.db.sql.SubSelectParamExpr> getParamExprs()
public boolean isSelect()
public boolean isReadOnly()
public void setGroup(boolean isGroup)
public boolean isGroup()
protected void bind()
throws java.sql.SQLException
java.sql.SQLException
protected void generateWhere(Expr whereExpr)
throws java.sql.SQLException
java.sql.SQLException
protected Expr bind(java.lang.String tableName,
java.lang.String columnName)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void clearParameters()
public void setBoolean(int index,
boolean value)
public void setString(int index,
java.lang.String value)
public void setLong(int index,
long value)
public void setDouble(int index,
double value)
public void setDate(int index,
long value)
public void setBinaryStream(int index,
java.io.InputStream is,
int length)
public void setBytes(int index,
byte[] bytes)
public abstract void execute(QueryContext queryCtx,
Transaction xa)
throws java.sql.SQLException
java.sql.SQLException
protected boolean start(TableIterator[] rows,
int rowLength,
QueryContext queryContext,
Transaction xa)
throws java.sql.SQLException
java.sql.SQLException
protected boolean nextTuple(TableIterator[] rows,
int rowLength,
QueryContext queryContext,
Transaction xa)
throws java.sql.SQLException
java.sql.SQLException
protected void freeRows(TableIterator[] rows,
int rowLength)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||