| java.lang.Object org.apache.derby.impl.sql.compile.QueryTreeNode org.apache.derby.impl.sql.compile.StatementNode org.apache.derby.impl.sql.compile.DMLStatementNode
All known Subclasses: org.apache.derby.impl.sql.compile.DMLModStatementNode, org.apache.derby.impl.sql.compile.CursorNode, org.apache.derby.impl.sql.compile.CallStatementNode,
DMLStatementNode | abstract class DMLStatementNode extends StatementNode (Code) | | A DMLStatementNode represents any type of DML statement: a cursor declaration,
an INSERT statement, and UPDATE statement, or a DELETE statement. All DML
statements have result sets, but they do different things with them. A
SELECT statement sends its result set to the client, an INSERT statement
inserts its result set into a table, a DELETE statement deletes from a
table the rows corresponding to the rows in its result set, and an UPDATE
statement updates the rows in a base table corresponding to the rows in its
result set.
author: Jeff Lichtman |
resultSet | ResultSetNode resultSet(Code) | | The result set is the rows that result from running the
statement. What this means for SELECT statements is fairly obvious.
For a DELETE, there is one result column representing the
key of the row to be deleted (most likely, the location of the
row in the underlying heap). For an UPDATE, the row consists of
the key of the row to be updated plus the updated columns. For
an INSERT, the row consists of the new column values to be
inserted, with no key (the system generates a key).
The parser doesn't know anything about keys, so the columns
representing the keys will be added after parsing (perhaps in
the binding phase?).
|
activationKind | int activationKind()(Code) | | Returns the type of activation this class
generates.
either (NEED_ROW_ACTIVATION | NEED_PARAM_ACTIVATION) or(NEED_ROW_ACTIVATION) depending on params |
bind | public QueryTreeNode bind(DataDictionary dataDictionary) throws StandardException(Code) | | Bind this DMLStatementNode. This means looking up tables and columns and
getting their types, and figuring out the result types of all
expressions, as well as doing view resolution, permissions checking,
etc.
Parameters: dataDictionary - The DataDictionary to use to look upcolumns, tables, etc. The bound query tree exception: StandardException - Thrown on error |
bindExpressionsWithTables | protected void bindExpressionsWithTables() throws StandardException(Code) | | Bind the expressions in the underlying ResultSets with tables.
exception: StandardException - Thrown on error |
bindResultSetsWithTables | public QueryTreeNode bindResultSetsWithTables(DataDictionary dataDictionary) throws StandardException(Code) | | Bind only the underlying ResultSets with tables. This is necessary for
INSERT, where the binding order depends on the underlying ResultSets.
This means looking up tables and columns and
getting their types, and figuring out the result types of all
expressions, as well as doing view resolution, permissions checking,
etc.
Parameters: dataDictionary - The DataDictionary to use to look upcolumns, tables, etc. The bound query tree exception: StandardException - Thrown on error |
generateParameterValueSet | void generateParameterValueSet(ActivationClassBuilder acb) throws StandardException(Code) | | Generate the code to create the ParameterValueSet, if necessary,
when constructing the activation. Also generate the code to call
a method that will throw an exception if we try to execute without
all the parameters being set.
Parameters: acb - The ActivationClassBuilder for the class we're building |
getPrivType | int getPrivType()(Code) | | Return default privilege needed for this node. Other DML nodes can override
this method to set their own default privilege.
true if the statement is atomic |
getResultSetNode | public ResultSetNode getResultSetNode()(Code) | | Get the ResultSetNode from this DML Statement.
(Useful for view resolution after parsing the view definition.)
ResultSetNode The ResultSetNode from this DMLStatementNode. |
init | public void init(Object resultSet)(Code) | | Initializer for a DMLStatementNode
Parameters: resultSet - A ResultSetNode for the result set of theDML statement |
isAtomic | public boolean isAtomic() throws StandardException(Code) | | A read statement is atomic (DMLMod overrides us) if there
are no work units, and no SELECT nodes, or if its SELECT nodes
are all arguments to a function. This is admittedly
a bit simplistic, what if someone has:
VALUES myfunc(SELECT max(c.commitFunc()) FROM T)
but we aren't going too far out of our way to
catch every possible wierd case. We basically
want to be permissive w/o allowing someone to partially
commit a write.
true if the statement is atomic exception: StandardException - on error |
makeResultDescription | public ResultDescription makeResultDescription()(Code) | | Make a ResultDescription for use in a PreparedStatement.
ResultDescriptions are visible to JDBC only for cursor statements.
For other types of statements, they are only used internally to
get descriptions of the base tables being affected. For example,
for an INSERT statement, the ResultDescription describes the
rows in the table being inserted into, which is useful when
the values being inserted are of a different type or length
than the columns in the base table.
A ResultDescription for this DML statement |
optimize | public QueryTreeNode optimize() throws StandardException(Code) | | Optimize a DML statement (which is the only type of statement that
should need optimizing, I think). This method over-rides the one
in QueryTreeNode.
This method takes a bound tree, and returns an optimized tree.
It annotates the bound tree rather than creating an entirely
new tree.
Throws an exception if the tree is not bound, or if the binding
is out of date.
An optimized QueryTree exception: StandardException - Thrown on error |
printSubNodes | public void printSubNodes(int depth)(Code) | | Prints the sub-nodes of this object. See QueryTreeNode.java for
how tree printing is supposed to work.
Parameters: depth - The depth of this node in the tree |
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)
|
|
|