|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.ResultSetNode
org.apache.derby.impl.sql.compile.FromTable
org.apache.derby.impl.sql.compile.CurrentOfNode
public final class CurrentOfNode
The CurrentOf operator is used by positioned DELETE and UPDATE to get the current row and location for the target cursor. The bind() operations for positioned DELETE and UPDATE add a column to the select list under the statement for the row location accessible from this node. This node is placed in the from clause of the select generated for the delete or update operation. It acts much like a FromBaseTable, using the information about the target table of the cursor to provide information.
Field Summary | |
---|---|
private TableName |
baseTableName
|
private java.lang.String |
cursorName
|
private TableName |
exposedTableName
|
private ExecPreparedStatement |
preStmt
|
private CostEstimate |
singleScanCostEstimate
|
Fields inherited from class org.apache.derby.impl.sql.compile.FromTable |
---|
ADD_PLAN, bestAccessPath, bestCostEstimate, bestSortAvoidancePath, correlationName, corrTableName, currentAccessPath, hashKeyColumns, initialCapacity, level, LOAD_PLAN, loadFactor, maxCapacity, origTableName, REMOVE_PLAN, tableNumber, tableProperties, trulyTheBestAccessPath, userSpecifiedJoinStrategy |
Fields inherited from class org.apache.derby.impl.sql.compile.ResultSetNode |
---|
costEstimate, cursorTargetTable, finalCostEstimate, insertSource, optimizer, referencedTableMap, resultColumns, resultSetNumber, scratchCostEstimate, statementResultSet |
Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode |
---|
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX, isPrivilegeCollectionRequired |
Constructor Summary | |
---|---|
CurrentOfNode()
|
Method Summary | |
---|---|
void |
bindExpressions(FromList fromListParam)
Bind the expressions in this ResultSetNode. |
ResultSetNode |
bindNonVTITables(DataDictionary dataDictionary,
FromList fromListParam)
Binding this FromTable means finding the prepared statement for the cursor and creating the result columns (the columns updatable on that cursor). |
CostEstimate |
estimateCost(OptimizablePredicateList predList,
ConglomerateDescriptor cd,
CostEstimate outerCost,
Optimizer optimizer,
RowOrdering rowOrdering)
Estimate the cost of scanning this Optimizable using the given predicate list with the given conglomerate. |
void |
generate(ActivationClassBuilder acb,
MethodBuilder mb)
Generation on a CurrentOfNode creates a scan on the cursor, CurrentOfResultSet. |
TableName |
getBaseCursorTargetTableName()
|
java.lang.String |
getCursorName()
|
(package private) ExecPreparedStatement |
getCursorStatement()
Return the CursorNode associated with a positioned update/delete. |
java.lang.String |
getExposedName()
Get the exposed name for this table, which is the name that can be used to refer to it in the rest of the query. |
TableName |
getExposedTableName()
|
ResultColumn |
getMatchingColumn(ColumnReference columnReference)
Try to find a ResultColumn in the table represented by this CurrentOfNode that matches the name in the given ColumnReference. |
void |
init(java.lang.Object correlationName,
java.lang.Object cursor,
java.lang.Object tableProperties)
Initialize a query tree node. |
ResultSetNode |
optimize(DataDictionary dataDictionary,
PredicateList predicateList,
double outerRows)
Optimize this CurrentOfNode. |
ResultSetNode |
preprocess(int numTables,
GroupByList gbl,
FromList fromList)
Preprocess a CurrentOfNode. |
void |
printSubNodes(int depth)
Prints the sub-nodes of this object. |
java.lang.String |
toString()
Convert this object to a String. |
int |
updateTargetLockMode()
Get the lock mode for this table as the target of an update statement (a delete or update). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.derby.iapi.sql.compile.Optimizable |
---|
getDataDictionary, getReferencedTableMap, getResultSetNumber |
Field Detail |
---|
private java.lang.String cursorName
private ExecPreparedStatement preStmt
private TableName exposedTableName
private TableName baseTableName
private CostEstimate singleScanCostEstimate
Constructor Detail |
---|
public CurrentOfNode()
Method Detail |
---|
public void init(java.lang.Object correlationName, java.lang.Object cursor, java.lang.Object tableProperties)
QueryTreeNode
init
in class QueryTreeNode
public CostEstimate estimateCost(OptimizablePredicateList predList, ConglomerateDescriptor cd, CostEstimate outerCost, Optimizer optimizer, RowOrdering rowOrdering) throws StandardException
Optimizable
estimateCost
in interface Optimizable
estimateCost
in class FromTable
predList
- The predicate list to optimize againstcd
- The conglomerate descriptor to get the cost ofouterCost
- The estimated cost of the part of the plan outer
to this optimizable.optimizer
- The optimizer to use to help estimate the costrowOrdering
- The row ordering for all the tables in the
join order, including this one.
StandardException
- Thrown on errorOptimizable.estimateCost(org.apache.derby.iapi.sql.compile.OptimizablePredicateList, org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor, org.apache.derby.iapi.sql.compile.CostEstimate, org.apache.derby.iapi.sql.compile.Optimizer, org.apache.derby.iapi.sql.compile.RowOrdering)
public ResultSetNode bindNonVTITables(DataDictionary dataDictionary, FromList fromListParam) throws StandardException
bindNonVTITables
in class ResultSetNode
dataDictionary
- The DataDictionary to use for bindingfromListParam
- FromList to use/append to.
StandardException
- Thrown on errorpublic void bindExpressions(FromList fromListParam)
bindExpressions
in class ResultSetNode
fromListParam
- FromList to use/append to.public ResultColumn getMatchingColumn(ColumnReference columnReference) throws StandardException
getMatchingColumn
in class ResultSetNode
columnReference
- The columnReference whose name we're looking
for in the given table.
StandardException
- Thrown on errorpublic ResultSetNode preprocess(int numTables, GroupByList gbl, FromList fromList) throws StandardException
preprocess
in class ResultSetNode
numTables
- The number of tables in the DML Statementgbl
- The group by list, if anyfromList
- The from list, if any
StandardException
- Thrown on errorpublic ResultSetNode optimize(DataDictionary dataDictionary, PredicateList predicateList, double outerRows) throws StandardException
optimize
in class ResultSetNode
dataDictionary
- The DataDictionary to use for optimizationpredicateList
- The PredicateList to optimize. This should
be a single-table predicate with the table
the same as the table in this FromTable.outerRows
- The number of outer joining rows
StandardException
- Thrown on errorpublic void generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException
This routine will generate and return a call of the form:
ResultSetFactory.getCurrentOfResultSet(cursorName)
generate
in class QueryTreeNode
acb
- The ActivationClassBuilder for the class being builtmb
- The execute() method to be built
StandardException
- Thrown on errorpublic void printSubNodes(int depth)
printSubNodes
in class ResultSetNode
depth
- The depth of this node in the treepublic java.lang.String toString()
toString
in class FromTable
public java.lang.String getExposedName()
FromTable
getExposedName
in class FromTable
public TableName getExposedTableName()
public TableName getBaseCursorTargetTableName()
public java.lang.String getCursorName()
ExecPreparedStatement getCursorStatement()
public int updateTargetLockMode()
updateTargetLockMode
in class ResultSetNode
TransactionController
|
Built on Thu 2011-03-10 11:54:14+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |