|
||||||||||
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.StatementNode
org.apache.derby.impl.sql.compile.DMLStatementNode
org.apache.derby.impl.sql.compile.DMLModStatementNode
org.apache.derby.impl.sql.compile.DeleteNode
A DeleteNode represents a DELETE statement. It is the top-level node for the statement. For positioned delete, there may be no from table specified. The from table will be derived from the cursor specification of the named cursor.
Field Summary | |
private boolean |
cascadeDelete
|
static java.lang.String |
COLUMNNAME
|
protected boolean |
deferred
|
private ConstantAction[] |
dependentConstantActions
|
private QueryTreeNode[] |
dependentNodes
|
protected ExecRow |
emptyHeapRow
|
protected FKInfo |
fkInfo
|
protected FormatableBitSet |
readColsBitSet
|
protected FromTable |
targetTable
|
Fields inherited from class org.apache.derby.impl.sql.compile.DMLModStatementNode |
fkColArrays, fkColDescriptors, fkIndexConglomNumbers, fkRefActions, fkTableNames, graphHashTable, indexConglomerateNumbers, indexNames, indicesToMaintain, isDependentTable, lockMode, relevantCdl, relevantTriggers, resultColumnList, targetTableDescriptor, targetTableName, targetVTI, triggerInfo |
Fields inherited from class org.apache.derby.impl.sql.compile.DMLStatementNode |
resultSet |
Fields inherited from class org.apache.derby.impl.sql.compile.StatementNode |
NEED_CURSOR_ACTIVATION, NEED_DDL_ACTIVATION, NEED_NOTHING_ACTIVATION, NEED_PARAM_ACTIVATION, NEED_ROW_ACTIVATION |
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 | |
DeleteNode()
|
Method Summary | |
QueryTreeNode |
bind()
Bind this DeleteNode. |
void |
generate(ActivationClassBuilder acb,
MethodBuilder mb)
Code generation for delete. |
private static FormatableBitSet |
getDeleteReadMap(TableDescriptor baseTable,
java.util.Vector conglomVector,
GenericDescriptorList relevantTriggers,
boolean[] needsDeferredProcessing)
Builds a bitmap of all columns which should be read from the Store in order to satisfy an DELETE statement. 1) finds all indices on this table 2) adds the index columns to a bitmap of affected columns 3) adds the index descriptors to a list of conglomerate descriptors. 4) finds all DELETE triggers on the table 5) if there are any DELETE triggers, marks all columns in the bitmap 6) adds the triggers to an evolving list of triggers |
private QueryTreeNode |
getDependentTableNode(java.lang.String tableName,
int refAction,
ColumnDescriptorList cdl)
In case of referential actions, we require to perform DML (UPDATE or DELETE) on the dependent tables. |
private QueryTreeNode |
getEmptyDeleteNode(java.lang.String schemaName,
java.lang.String targetTableName)
|
private QueryTreeNode |
getEmptyUpdateNode(java.lang.String schemaName,
java.lang.String targetTableName,
ColumnDescriptorList cdl)
|
FormatableBitSet |
getReadMap(DataDictionary dd,
TableDescriptor baseTable)
Gets the map of all columns which must be read out of the base table. |
private ResultColumnList |
getSetClause(TableName tabName,
ColumnDescriptorList cdl)
|
protected int |
getStatementType()
Return the type of statement, something from StatementType. |
void |
init(java.lang.Object targetTableName,
java.lang.Object queryExpression)
Initializer for a DeleteNode. |
ConstantAction |
makeConstantAction()
Compile constants that Execution will use |
QueryTreeNode |
optimize()
Generate an optimized QueryTree from a bound QueryTree. |
boolean |
referencesSessionSchema()
Return true if the node references SESSION schema tables (temporary or permanent) |
java.lang.String |
statementToString()
|
Methods inherited from class org.apache.derby.impl.sql.compile.DMLStatementNode |
accept, activationKind, bind, bindExpressions, bindExpressionsWithTables, bindResultSetsWithTables, bindTables, generateParameterHolders, generateParameterValueSet, getResultSetNode, makeResultDescription, printSubNodes |
Methods inherited from class org.apache.derby.impl.sql.compile.StatementNode |
generate, lockTableForCompilation, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String COLUMNNAME
protected boolean deferred
protected ExecRow emptyHeapRow
protected FromTable targetTable
protected FKInfo fkInfo
protected FormatableBitSet readColsBitSet
private ConstantAction[] dependentConstantActions
private boolean cascadeDelete
private QueryTreeNode[] dependentNodes
Constructor Detail |
public DeleteNode()
Method Detail |
public void init(java.lang.Object targetTableName, java.lang.Object queryExpression)
init
in class DMLModStatementNode
targetTableName
- The name of the table to delete fromqueryExpression
- used by nodes that allocate a DMLMod directly
(rather than inheriting it).public java.lang.String statementToString()
statementToString
in class DMLModStatementNode
public QueryTreeNode bind() throws StandardException
If any indexes need to be updated, we add all the columns in the base table to the result column list, so that we can use the column values as look-up keys for the index rows to be deleted. Binding a delete will also massage the tree so that the ResultSetNode has column containing the RowLocation of the base row.
bind
in class QueryTreeNode
StandardException
- Thrown on errorpublic boolean referencesSessionSchema() throws StandardException
referencesSessionSchema
in class QueryTreeNode
StandardException
- Thrown on errorpublic ConstantAction makeConstantAction() throws StandardException
makeConstantAction
in class QueryTreeNode
StandardException
- Thrown on failurepublic void generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException
generate
in class QueryTreeNode
acb
- The ActivationClassBuilder for the class being builtmb
- The execute() method to be built
StandardException
- Thrown on errorprotected final int getStatementType()
getStatementType
in class QueryTreeNode
public FormatableBitSet getReadMap(DataDictionary dd, TableDescriptor baseTable) throws StandardException
dd
- the data dictionary to look inbaseTable
- the base table descriptor
StandardException
- Thrown on errorprivate QueryTreeNode getDependentTableNode(java.lang.String tableName, int refAction, ColumnDescriptorList cdl) throws StandardException
StandardException
private QueryTreeNode getEmptyDeleteNode(java.lang.String schemaName, java.lang.String targetTableName) throws StandardException
StandardException
private QueryTreeNode getEmptyUpdateNode(java.lang.String schemaName, java.lang.String targetTableName, ColumnDescriptorList cdl) throws StandardException
StandardException
private ResultColumnList getSetClause(TableName tabName, ColumnDescriptorList cdl) throws StandardException
StandardException
public QueryTreeNode optimize() throws StandardException
DMLModStatementNode
optimize
in class DMLModStatementNode
StandardException
- Thrown on failureprivate static FormatableBitSet getDeleteReadMap(TableDescriptor baseTable, java.util.Vector conglomVector, GenericDescriptorList relevantTriggers, boolean[] needsDeferredProcessing) throws StandardException
conglomVector
- OUT: vector of affected indicesrelevantTriggers
- IN/OUT. Passed in as an empty list. Filled in as we go.needsDeferredProcessing
- IN/OUT. true if the statement already needs
deferred processing. set while evaluating this
routine if a trigger requires
deferred processing
StandardException
- Thrown on error
|
Built on Tue 2006-10-10 19:23:47+0200, from revision exported | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |