|
||||||||||
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.UpdateNode
An UpdateNode represents an UPDATE statement. It is the top node of the query tree for that statement. For positioned update, there may be no from table specified. The from table will be derived from the cursor specification of the named cursor.
Field Summary | |
int[] |
changedColumnIds
|
ValueNode |
checkConstraints
|
static java.lang.String |
COLUMNNAME
|
boolean |
deferred
|
ExecRow |
emptyHeapRow
|
FKInfo |
fkInfo
|
protected boolean |
positionedUpdate
|
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 | |
UpdateNode()
|
Method Summary | |
QueryTreeNode |
bind()
Bind this UpdateNode. |
void |
generate(ActivationClassBuilder acb,
MethodBuilder mb)
Code generation for update. |
private int[] |
getChangedColumnIds(ResultColumnList rcl)
Construct the changedColumnIds array. |
FormatableBitSet |
getReadMap(DataDictionary dd,
TableDescriptor baseTable,
ResultColumnList updateColumnList)
Gets the map of all columns which must be read out of the base table. |
protected int |
getStatementType()
Return the type of statement, something from StatementType. |
static FormatableBitSet |
getUpdateReadMap(TableDescriptor baseTable,
ResultColumnList updateColumnList,
java.util.Vector conglomVector,
ConstraintDescriptorList relevantConstraints,
GenericDescriptorList relevantTriggers,
boolean[] needsDeferredProcessing)
Builds a bitmap of all columns which should be read from the Store in order to satisfy an UPDATE statement. |
void |
init(java.lang.Object targetTableName,
java.lang.Object resultSet)
Initializer for an UpdateNode. |
ConstantAction |
makeConstantAction()
Compile constants that Execution will use |
void |
printSubNodes(int depth)
Prints the sub-nodes of this object. |
boolean |
referencesSessionSchema()
Return true if the node references SESSION schema tables (temporary or permanent) |
protected void |
setDeferredForUpdateOfIndexColumn()
Updates are deferred if they update a column in the index used to scan the table being updated. |
java.lang.String |
statementToString()
|
java.lang.String |
toString()
Convert this object to a String. |
Methods inherited from class org.apache.derby.impl.sql.compile.DMLStatementNode |
accept, activationKind, bind, bindExpressions, bindExpressionsWithTables, bindResultSetsWithTables, bindTables, generateParameterHolders, generateParameterValueSet, getResultSetNode, makeResultDescription |
Methods inherited from class org.apache.derby.impl.sql.compile.StatementNode |
generate, lockTableForCompilation |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public int[] changedColumnIds
public ExecRow emptyHeapRow
public boolean deferred
public ValueNode checkConstraints
public FKInfo fkInfo
protected FromTable targetTable
protected FormatableBitSet readColsBitSet
protected boolean positionedUpdate
public static final java.lang.String COLUMNNAME
Constructor Detail |
public UpdateNode()
Method Detail |
public void init(java.lang.Object targetTableName, java.lang.Object resultSet)
init
in class DMLModStatementNode
targetTableName
- The name of the table to updateresultSet
- The ResultSet that will generate
the rows to update from the given tablepublic java.lang.String toString()
toString
in class StatementNode
public java.lang.String statementToString()
statementToString
in class DMLModStatementNode
public void printSubNodes(int depth)
printSubNodes
in class DMLStatementNode
depth
- The depth of this node in the tree
public QueryTreeNode bind() throws StandardException
Binding an update will also massage the tree so that the ResultSetNode has a set of columns to contain the old row value, followed by a set of columns to contain the new row value, followed by a column to contain the RowLocation of the row to be updated.
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 failureprotected void setDeferredForUpdateOfIndexColumn()
public void generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException
generate
in class QueryTreeNode
acb
- The ActivationClassBuilder for the class being builtmb
- The method for the execute() method to be built
StandardException
- Thrown on errorprotected final int getStatementType()
getStatementType
in class QueryTreeNode
public FormatableBitSet getReadMap(DataDictionary dd, TableDescriptor baseTable, ResultColumnList updateColumnList) throws StandardException
The returned map is a FormatableBitSet with 1 bit for each column in the table plus an extra, unsued 0-bit. If a 1-based column id must be read from the base table, then the corresponding 1-based bit is turned ON in the returned FormatableBitSet.
NOTE: this method is not expected to be called when all columns are being updated (i.e. updateColumnList is null).
dd
- the data dictionary to look inbaseTable
- the base table descriptorupdateColumnList
- the rcl for the update. CANNOT BE NULL
StandardException
- Thrown on errorprivate int[] getChangedColumnIds(ResultColumnList rcl)
public static FormatableBitSet getUpdateReadMap(TableDescriptor baseTable, ResultColumnList updateColumnList, java.util.Vector conglomVector, ConstraintDescriptorList relevantConstraints, GenericDescriptorList relevantTriggers, boolean[] needsDeferredProcessing) throws StandardException
updateColumnList
- a list of updated columnsconglomVector
- OUT: vector of affected indicesrelevantConstraints
- IN/OUT. Empty list is passed in. We hang constraints on it as we go.relevantTriggers
- 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 or constraint requires
deferred processing
StandardException
- Thrown on error
|
Built on Mon 2007-06-04 09:58:47+0400, from revision ??? | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |