| java.lang.Object org.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
All known Subclasses: org.apache.derby.impl.sql.compile.InsertNode, org.apache.derby.impl.sql.compile.DeleteNode, org.apache.derby.impl.sql.compile.UpdateNode,
DMLModStatementNode | abstract class DMLModStatementNode extends DMLStatementNode (Code) | | A DMLStatement for a table modification: to wit, INSERT
UPDATE or DELETE.
author: Jamie |
Method Summary | |
protected void | adjustDeferredFlag(boolean adjustment) | public void | bindCheckConstraint(NodeFactory nodeFactory, TableDescriptor targetTableDescriptor, ResultColumnList sourceRCL, ValueNode checkConstraint) | public ValueNode | bindConstraints(DataDictionary dataDictionary, NodeFactory nodeFactory, TableDescriptor targetTableDescriptor, Dependent dependent, ResultColumnList sourceRCL, int[] changedColumnIds, FormatableBitSet readColsBitSet, boolean skipCheckConstraints, boolean includeTriggers) Gets and binds all the constraints for an INSERT/UPDATE/DELETE.
First finds the constraints that are relevant to this node.
This is done by calling getAllRelevantConstriants(). | public void | generateCheckConstraints(ValueNode checkConstraints, ExpressionClassBuilder ecb, MethodBuilder mb) Generate the code to evaluate a tree of CHECK CONSTRAINTS. | public MethodBuilder | generateCheckConstraints(ValueNode checkConstraints, ExpressionClassBuilder ecb) Generate a method to evaluate a tree of CHECK CONSTRAINTS. | protected void | generateCodeForTemporaryTable(ActivationClassBuilder acb, MethodBuilder mb) If the DML is on a temporary table, generate the code to mark temporary table as modified in the current UOW. | protected void | getAffectedIndexes(TableDescriptor td, ResultColumnList updatedColumns, FormatableBitSet colBitSet) Get the list of indexes that must be updated by this DML statement.
WARNING: As a side effect, it creates dependencies on those indexes.
Parameters: td - The table descriptor for the table being updated Parameters: updatedColumns - The updated column list. | protected ConstraintDescriptorList | getAllRelevantConstraints(DataDictionary dd, TableDescriptor td, boolean skipCheckConstraints, int[] changedColumnIds) | protected GenericDescriptorList | getAllRelevantTriggers(DataDictionary dd, TableDescriptor td, int[] changedColumnIds, boolean includeTriggers) | public ValueNode | getCheckConstraints() | public FKInfo[] | getFKInfo() Return the FKInfo structure. | public static int[] | getReadColMap(int column_map_length, FormatableBitSet readColsBitSet) Get a map to efficiently find heap columns from a compressed set of
read columns. | protected void | getResultColumnList() Get and bind the ResultColumnList representing the columns in the
target table, given the table's name. | protected FromBaseTable | getResultColumnList(ResultColumnList inputRcl) Get and bind the ResultColumnList representing the columns in the
target table, given the table's name. | public SchemaDescriptor | getSchemaDescriptor() Get a schema descriptor for the given table. | public TriggerInfo | getTriggerInfo() Return the TriggerInfo structure. | static void | getXAffectedIndexes(TableDescriptor baseTable, ResultColumnList updatedColumns, FormatableBitSet colBitSet, Vector conglomVector) Marks which indexes are affected by an UPDATE of the
desired shape.
Is passed a list of updated columns. | protected boolean | hasCheckConstraints(DataDictionary dd, TableDescriptor td) Determine whether or not there are check constraints on the
specified table. | public void | init(Object resultSet) | public void | init(Object resultSet, Object statementType) | public boolean | isAtomic() INSERT/UPDATE/DELETE are always atomic. | protected void | markAffectedIndexes(Vector affectedConglomerates) | public void | normalizeSynonymColumns(ResultColumnList rcl, TableName targetTableName) Normalize synonym column references to have the name of the base table. | public QueryTreeNode | optimize() Generate an optimized QueryTree from a bound QueryTree. | public ValueNode | parseCheckConstraint(String checkConstraintText, TableDescriptor td) Parse a check constraint and turn it into a query tree. | public boolean | requiresDeferredProcessing() Does this DML Node require deferred processing?
Set to true if we have triggers or referential
constraints that need deferred processing. | public void | setRefActionInfo(long fkIndexConglomId, int[] fkColArray, String parentResultSetId, boolean dependentScan) | void | setTarget(QueryTreeNode targetName) | public String | statementToString() | void | verifyTargetTable() Verify the target table. |
fkColArrays | protected int[][] fkColArrays(Code) | | |
fkIndexConglomNumbers | protected long[] fkIndexConglomNumbers(Code) | | |
fkRefActions | protected int[] fkRefActions(Code) | | |
indexConglomerateNumbers | public long[] indexConglomerateNumbers(Code) | | |
isDependentTable | protected boolean isDependentTable(Code) | | |
lockMode | protected int lockMode(Code) | | |
adjustDeferredFlag | protected void adjustDeferredFlag(boolean adjustment)(Code) | | |
bindCheckConstraint | public void bindCheckConstraint(NodeFactory nodeFactory, TableDescriptor targetTableDescriptor, ResultColumnList sourceRCL, ValueNode checkConstraint) throws StandardException(Code) | | Binds an already parsed check constraint
Parameters: nodeFactory - Where to get query tree nodes. Parameters: targetTableDescriptor - The TableDescriptor for the constrained table. Parameters: sourceRCL - Result columns. Parameters: checkConstraint - Parsed query tree for check constraint exception: StandardException - Thrown on failure |
bindConstraints | public ValueNode bindConstraints(DataDictionary dataDictionary, NodeFactory nodeFactory, TableDescriptor targetTableDescriptor, Dependent dependent, ResultColumnList sourceRCL, int[] changedColumnIds, FormatableBitSet readColsBitSet, boolean skipCheckConstraints, boolean includeTriggers) throws StandardException(Code) | | Gets and binds all the constraints for an INSERT/UPDATE/DELETE.
First finds the constraints that are relevant to this node.
This is done by calling getAllRelevantConstriants(). If
getAllRelevantConstraints() has already been called, then
this list is used. Then it creates appropriate
dependencies. Then binds check constraints. It also
generates the array of FKInfo items that are used in
code generation.
Note: we have a new flag here to see if defer processing is enabled or
not, the only scenario that is disabled is when we reapply the
reply message we get from the source
Parameters: dataDictionary - The DataDictionary Parameters: nodeFactory - Where to get query tree nodes. Parameters: targetTableDescriptor - The TableDescriptor Parameters: dependent - Parent object that will depend on all the constraintsthat we look up. If this argument is null, then weuse the default dependent (the statement being compiled). Parameters: sourceRCL - RCL of the table being changed Parameters: changedColumnIds - If null, all columns being changed, otherwise arrayof 1-based column ids for columns being changed Parameters: readColsBitSet - bit set for the read scan Parameters: skipCheckConstraints - whether to skip check constraints or not Parameters: includeTriggers - whether triggers are included in the processing The bound, ANDed check constraints as a query tree. exception: StandardException - Thrown on failure |
generateCodeForTemporaryTable | protected void generateCodeForTemporaryTable(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException(Code) | | If the DML is on a temporary table, generate the code to mark temporary table as modified in the current UOW.
At rollback transaction (or savepoint), we will check if the temporary table was modified in that UOW.
If yes, we will remove all the data from the temporary table
Parameters: acb - The ActivationClassBuilder for the class being built Parameters: mb - The execute() method to be built exception: StandardException - Thrown on error |
getAffectedIndexes | protected void getAffectedIndexes(TableDescriptor td, ResultColumnList updatedColumns, FormatableBitSet colBitSet) throws StandardException(Code) | | Get the list of indexes that must be updated by this DML statement.
WARNING: As a side effect, it creates dependencies on those indexes.
Parameters: td - The table descriptor for the table being updated Parameters: updatedColumns - The updated column list. If not update, null Parameters: colBitSet - a 1 based bit set of the columns in the list exception: StandardException - Thrown on error |
getAllRelevantConstraints | protected ConstraintDescriptorList getAllRelevantConstraints(DataDictionary dd, TableDescriptor td, boolean skipCheckConstraints, int[] changedColumnIds) throws StandardException(Code) | | Get all the constraints relevant to this DML operation
Parameters: dd - The DataDictionary Parameters: td - The TableDescriptor Parameters: skipCheckConstraints - Skip check constraints Parameters: changedColumnIds - If null, all columns being changed, otherwise arrayof 1-based column ids for columns being changed the constraint descriptor list exception: StandardException - Thrown on failure |
getAllRelevantTriggers | protected GenericDescriptorList getAllRelevantTriggers(DataDictionary dd, TableDescriptor td, int[] changedColumnIds, boolean includeTriggers) throws StandardException(Code) | | Get all the triggers relevant to this DML operation
Parameters: dd - The data dictionary Parameters: td - The TableDescriptor Parameters: changedColumnIds - If null, all columns being changed, otherwise arrayof 1-based column ids for columns being changed Parameters: includeTriggers - whether we allow trigger processing or not forthis table the constraint descriptor list exception: StandardException - Thrown on failure |
getCheckConstraints | public ValueNode getCheckConstraints()(Code) | | Get the check constraints for this node
the check constraints, may be null |
getFKInfo | public FKInfo[] getFKInfo()(Code) | | Return the FKInfo structure. Just a little wrapper
to make sure we don't try to access it until after
binding.
the array of fkinfos |
getReadColMap | public static int[] getReadColMap(int column_map_length, FormatableBitSet readColsBitSet)(Code) | | Get a map to efficiently find heap columns from a compressed set of
read columns. The returns a map such that
map[heapColId (0 based)] -> readCol id (0 based)
Parameters: column_map_length - The number of columns(ints) in the map. Parameters: readColsBitSet - A language style (1 based) bit set with bits forread heap columns set.RESOLVE: Replace this with a call to RowUtil when the store andthe language both use 0 base or 1 base offsets for columns. Todaywe can't use the store function because we have a 1 based FormatableBitSet. |
getResultColumnList | protected void getResultColumnList() throws StandardException(Code) | | Get and bind the ResultColumnList representing the columns in the
target table, given the table's name.
exception: StandardException - Thrown on error |
getTriggerInfo | public TriggerInfo getTriggerInfo()(Code) | | Return the TriggerInfo structure. Just a little wrapper
to make sure we don't try to access it until after
binding.
the trigger info |
getXAffectedIndexes | static void getXAffectedIndexes(TableDescriptor baseTable, ResultColumnList updatedColumns, FormatableBitSet colBitSet, Vector conglomVector) throws StandardException(Code) | | Marks which indexes are affected by an UPDATE of the
desired shape.
Is passed a list of updated columns. Does the following:
1) finds all indices which overlap the updated columns
2) adds the index columns to a bitmap of affected columns
3) adds the index descriptors to a list of conglomerate
descriptors.
Parameters: updatedColumns - a list of updated columns Parameters: colBitSet - OUT: evolving bitmap of affected columns Parameters: conglomVector - OUT: vector of affected indices exception: StandardException - Thrown on error |
hasCheckConstraints | protected boolean hasCheckConstraints(DataDictionary dd, TableDescriptor td) throws StandardException(Code) | | Determine whether or not there are check constraints on the
specified table.
Parameters: dd - The DataDictionary to use Parameters: td - The TableDescriptor for the table Whether or not there are check constraints on the specified table. exception: StandardException - Thrown on failure |
init | public void init(Object resultSet)(Code) | | Initializer for a DMLModStatementNode -- delegate to DMLStatementNode
Parameters: resultSet - A ResultSetNode for the result set of theDML statement |
init | public void init(Object resultSet, Object statementType)(Code) | | Initializer for a DMLModStatementNode -- delegate to DMLStatementNode
Parameters: resultSet - A ResultSetNode for the result set of theDML statement Parameters: statementType - used by nodes that allocate a DMLMod directly(rather than inheriting it). |
isAtomic | public boolean isAtomic()(Code) | | INSERT/UPDATE/DELETE are always atomic.
true |
normalizeSynonymColumns | public void normalizeSynonymColumns(ResultColumnList rcl, TableName targetTableName) throws StandardException(Code) | | Normalize synonym column references to have the name of the base table.
Parameters: rcl - The result column list of the target table Parameters: targetTableName - The target tablename exception: StandardException - Thrown on error |
optimize | public QueryTreeNode optimize() throws StandardException(Code) | | Generate an optimized QueryTree from a bound QueryTree. Actually,
it can annotate the tree in place rather than generate a new tree,
but this interface allows the root node of the optimized QueryTree
to be different from the root node of the bound QueryTree.
For non-optimizable statements, this method is a no-op.
Throws an exception if the tree is not bound, or if the binding
is out of date.
An optimized QueryTree exception: StandardException - Thrown on failure |
parseCheckConstraint | public ValueNode parseCheckConstraint(String checkConstraintText, TableDescriptor td) throws StandardException(Code) | | Parse a check constraint and turn it into a query tree.
Parameters: checkConstraintText - Text of CHECK CONSTRAINT. Parameters: td - The TableDescriptor for the table the the constraint is on. The parsed check constraint as a query tree. exception: StandardException - Thrown on failure |
requiresDeferredProcessing | public boolean requiresDeferredProcessing()(Code) | | Does this DML Node require deferred processing?
Set to true if we have triggers or referential
constraints that need deferred processing.
true/false |
setRefActionInfo | public void setRefActionInfo(long fkIndexConglomId, int[] fkColArray, String parentResultSetId, boolean dependentScan)(Code) | | |
verifyTargetTable | void verifyTargetTable() throws StandardException(Code) | | Verify the target table. Get the TableDescriptor
if the target table is not a VTI.
exception: StandardException - Thrown on error |
Methods inherited from org.apache.derby.impl.sql.compile.QueryTreeNode | public Visitable accept(Visitor v) throws StandardException(Code)(Java Doc) public QueryTreeNode bind() throws StandardException(Code)(Java Doc) public DataValueDescriptor convertDefaultNode(DataTypeDescriptor typeDescriptor) throws StandardException(Code)(Java Doc) protected static void debugFlush()(Code)(Java Doc) public static void debugPrint(String outputString)(Code)(Java Doc) public void disablePrivilegeCollection()(Code)(Java Doc) public String executeSchemaName()(Code)(Java Doc) public String executeStatementName()(Code)(Java Doc) public static String formatNodeString(String nodeString, int depth)(Code)(Java Doc) public boolean foundString(String[] list, String search)(Code)(Java Doc) public GeneratedClass generate(ByteArray ignored) throws StandardException(Code)(Java Doc) protected void generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException(Code)(Java Doc) void generateAuthorizeCheck(ActivationClassBuilder acb, MethodBuilder mb, int sqlOperation)(Code)(Java Doc) public int getBeginOffset()(Code)(Java Doc) final protected ClassFactory getClassFactory()(Code)(Java Doc) final protected CompilerContext getCompilerContext()(Code)(Java Doc) final public ContextManager getContextManager()(Code)(Java Doc) public Object getCursorInfo() throws StandardException(Code)(Java Doc) final public DataDictionary getDataDictionary()(Code)(Java Doc) final public DependencyManager getDependencyManager()(Code)(Java Doc) public int getEndOffset()(Code)(Java Doc) final public ExecutionFactory getExecutionFactory()(Code)(Java Doc) final public GenericConstantActionFactory getGenericConstantActionFactory()(Code)(Java Doc) protected int getIntProperty(String value, String key) throws StandardException(Code)(Java Doc) final protected LanguageConnectionContext getLanguageConnectionContext()(Code)(Java Doc) final public NodeFactory getNodeFactory()(Code)(Java Doc) protected int getNodeType()(Code)(Java Doc) public ConstantNode getNullNode(TypeId typeId, ContextManager cm) throws StandardException(Code)(Java Doc) public DataTypeDescriptor[] getParameterTypes() throws StandardException(Code)(Java Doc) public long getRowEstimate()(Code)(Java Doc) public String getSPSName()(Code)(Java Doc) final SchemaDescriptor getSchemaDescriptor(String schemaName) throws StandardException(Code)(Java Doc) final SchemaDescriptor getSchemaDescriptor(String schemaName, boolean raiseError) throws StandardException(Code)(Java Doc) protected int getStatementType()(Code)(Java Doc) final protected TableDescriptor getTableDescriptor(String tableName, SchemaDescriptor schema) throws StandardException(Code)(Java Doc) final protected TypeCompiler getTypeCompiler(TypeId typeId)(Code)(Java Doc) public void init(Object arg1) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3, Object arg4) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11, Object arg12) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13) throws StandardException(Code)(Java Doc) public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14) throws StandardException(Code)(Java Doc) public boolean isAtomic() throws StandardException(Code)(Java Doc) protected boolean isInstanceOf(int nodeType)(Code)(Java Doc) public boolean isPrivilegeCollectionRequired()(Code)(Java Doc) final boolean isSessionSchema(SchemaDescriptor sd)(Code)(Java Doc) final boolean isSessionSchema(String schemaName)(Code)(Java Doc) public ConstantAction makeConstantAction() throws StandardException(Code)(Java Doc) public ResultDescription makeResultDescription() throws StandardException(Code)(Java Doc) public TableName makeTableName(String schemaName, String flatName) throws StandardException(Code)(Java Doc) public boolean needsSavepoint()(Code)(Java Doc) protected String nodeHeader()(Code)(Java Doc) public QueryTreeNode optimize() throws StandardException(Code)(Java Doc) public static QueryTreeNode parseQueryText(CompilerContext compilerContext, String queryText, Object[] paramDefaults, LanguageConnectionContext lcc) throws StandardException(Code)(Java Doc) public void printLabel(int depth, String label)(Code)(Java Doc) public void printSubNodes(int depth)(Code)(Java Doc) public boolean referencesSessionSchema() throws StandardException(Code)(Java Doc) public TableName resolveTableToSynonym(TableName tabName) throws StandardException(Code)(Java Doc) public void setBeginOffset(int beginOffset)(Code)(Java Doc) public void setContextManager(ContextManager cm)(Code)(Java Doc) public void setEndOffset(int endOffset)(Code)(Java Doc) public void setNodeType(int nodeType)(Code)(Java Doc) public void setRefActionInfo(long fkIndexConglomId, int[] fkColArray, String parentResultSetId, boolean dependentScan)(Code)(Java Doc) public String toString()(Code)(Java Doc) public void treePrint()(Code)(Java Doc) public void treePrint(int depth)(Code)(Java Doc) String verifyClassExist(String javaClassName, boolean convertCase) throws StandardException(Code)(Java Doc)
|
|
|