|
|||||||||
| Home >> All >> org >> apache >> derby >> impl >> sql >> [ compile overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.derby.impl.sql.compile
Class CurrentOfNode

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
- All Implemented Interfaces:
- org.apache.derby.iapi.sql.compile.Optimizable, org.apache.derby.iapi.sql.compile.Visitable
- public final class CurrentOfNode
- extends FromTable
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 org.apache.derby.iapi.sql.execute.ExecPreparedStatement |
preStmt
|
private org.apache.derby.iapi.sql.compile.CostEstimate |
singleScanCostEstimate
|
| Fields inherited from class org.apache.derby.impl.sql.compile.FromTable |
bestAccessPath, bestCostEstimate, bestSortAvoidancePath, correlationName, corrTableName, currentAccessPath, hashKeyColumns, initialCapacity, level, loadFactor, maxCapacity, tableNumber, tableProperties, trulyTheBestAccessPath, userSpecifiedJoinStrategy |
| Fields inherited from class org.apache.derby.impl.sql.compile.ResultSetNode |
costEstimate, cursorTargetTable, insertSource, optimizer, referencedTableMap, resultColumns, resultSetNumber, scratchCostEstimate, statementResultSet |
| Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode |
AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX, beginOffset, endOffset |
| Constructor Summary | |
CurrentOfNode()
|
|
| Method Summary | |
void |
bindExpressions(FromList fromListParam)
Bind the expressions in this ResultSetNode. |
ResultSetNode |
bindNonVTITables(org.apache.derby.iapi.sql.dictionary.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). |
org.apache.derby.iapi.sql.compile.CostEstimate |
estimateCost(org.apache.derby.iapi.sql.compile.OptimizablePredicateList predList,
org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor cd,
org.apache.derby.iapi.sql.compile.CostEstimate outerCost,
org.apache.derby.iapi.sql.compile.Optimizer optimizer,
org.apache.derby.iapi.sql.compile.RowOrdering rowOrdering)
Estimate the cost of scanning this Optimizable using the given predicate list with the given conglomerate. |
void |
generate(ActivationClassBuilder acb,
org.apache.derby.iapi.services.compiler.MethodBuilder mb)
Generation on a CurrentOfNode creates a scan on the cursor, CurrentOfResultSet. |
TableName |
getBaseCursorTargetTableName()
|
java.lang.String |
getCursorName()
|
(package private) org.apache.derby.iapi.sql.execute.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 cursor,
java.lang.Object tableProperties)
Initializer for a table in a FROM list. |
ResultSetNode |
optimize(org.apache.derby.iapi.sql.dictionary.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 |
cursorName
private java.lang.String cursorName
preStmt
private org.apache.derby.iapi.sql.execute.ExecPreparedStatement preStmt
exposedTableName
private TableName exposedTableName
baseTableName
private TableName baseTableName
singleScanCostEstimate
private org.apache.derby.iapi.sql.compile.CostEstimate singleScanCostEstimate
| Constructor Detail |
CurrentOfNode
public CurrentOfNode()
| Method Detail |
init
public void init(java.lang.Object cursor, java.lang.Object tableProperties)
- Description copied from class:
FromTable - Initializer for a table in a FROM list.
estimateCost
public org.apache.derby.iapi.sql.compile.CostEstimate estimateCost(org.apache.derby.iapi.sql.compile.OptimizablePredicateList predList, org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor cd, org.apache.derby.iapi.sql.compile.CostEstimate outerCost, org.apache.derby.iapi.sql.compile.Optimizer optimizer, org.apache.derby.iapi.sql.compile.RowOrdering rowOrdering) throws org.apache.derby.iapi.error.StandardException
- Description copied from interface:
org.apache.derby.iapi.sql.compile.Optimizable - Estimate the cost of scanning this Optimizable using the given
predicate list with the given conglomerate. It is assumed that the
predicate list has already been classified. This cost estimate is
just for one scan, not for the life of the query.
- Specified by:
estimateCostin interfaceorg.apache.derby.iapi.sql.compile.Optimizable- Overrides:
estimateCostin classFromTable
bindNonVTITables
public ResultSetNode bindNonVTITables(org.apache.derby.iapi.sql.dictionary.DataDictionary dataDictionary, FromList fromListParam) throws org.apache.derby.iapi.error.StandardException
- Binding this FromTable means finding the prepared statement
for the cursor and creating the result columns (the columns
updatable on that cursor).
We expect someone else to verify that the target table
of the positioned update or delete is the table under this cursor.
- Overrides:
bindNonVTITablesin classResultSetNode
bindExpressions
public void bindExpressions(FromList fromListParam)
- Bind the expressions in this ResultSetNode. This means binding the
sub-expressions, as well as figuring out what the return type is for
each expression.
- Overrides:
bindExpressionsin classResultSetNode
getMatchingColumn
public ResultColumn getMatchingColumn(ColumnReference columnReference) throws org.apache.derby.iapi.error.StandardException
- Try to find a ResultColumn in the table represented by this CurrentOfNode
that matches the name in the given ColumnReference.
- Overrides:
getMatchingColumnin classResultSetNode
preprocess
public ResultSetNode preprocess(int numTables, GroupByList gbl, FromList fromList) throws org.apache.derby.iapi.error.StandardException
- Preprocess a CurrentOfNode. For a CurrentOfNode, this simply means allocating
a referenced table map to avoid downstream NullPointerExceptions.
NOTE: There are no bits set in the referenced table map.
- Overrides:
preprocessin classResultSetNode
optimize
public ResultSetNode optimize(org.apache.derby.iapi.sql.dictionary.DataDictionary dataDictionary, PredicateList predicateList, double outerRows) throws org.apache.derby.iapi.error.StandardException
- Optimize this CurrentOfNode. Nothing to do.
- Overrides:
optimizein classResultSetNode
generate
public void generate(ActivationClassBuilder acb, org.apache.derby.iapi.services.compiler.MethodBuilder mb) throws org.apache.derby.iapi.error.StandardException
- Generation on a CurrentOfNode creates a scan on the
cursor, CurrentOfResultSet.
This routine will generate and return a call of the form:
ResultSetFactory.getCurrentOfResultSet(cursorName) - Overrides:
generatein classQueryTreeNode
printSubNodes
public void printSubNodes(int depth)
- Prints the sub-nodes of this object. See QueryTreeNode.java for
how tree printing is supposed to work.
- Overrides:
printSubNodesin classResultSetNode
toString
public java.lang.String toString()
- Convert this object to a String. See comments in QueryTreeNode.java
for how this should be done for tree printing.
getExposedName
public java.lang.String getExposedName()
- Description copied from class:
FromTable - 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.
- Overrides:
getExposedNamein classFromTable
getExposedTableName
public TableName getExposedTableName()
getBaseCursorTargetTableName
public TableName getBaseCursorTargetTableName()
getCursorName
public java.lang.String getCursorName()
getCursorStatement
org.apache.derby.iapi.sql.execute.ExecPreparedStatement getCursorStatement()
- Return the CursorNode associated with a positioned update/delete.
updateTargetLockMode
public int updateTargetLockMode()
- Get the lock mode for this table as the target of an update statement
(a delete or update). This is implemented only for base tables and
CurrentOfNodes.
- Overrides:
updateTargetLockModein classResultSetNode
|
|||||||||
| Home >> All >> org >> apache >> derby >> impl >> sql >> [ compile overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC