org.apache.derby.impl.sql.compile
Class CreateTriggerNode
java.lang.Object
org.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.StatementNode
org.apache.derby.impl.sql.compile.DDLStatementNode
org.apache.derby.impl.sql.compile.CreateTriggerNode
- All Implemented Interfaces:
- Visitable
public class CreateTriggerNode
- extends DDLStatementNode
A CreateTriggerNode is the root of a QueryTree
that represents a CREATE TRIGGER
statement.
Method Summary |
private boolean |
bindReferencesClause(DataDictionary dd)
|
void |
bindStatement()
Bind this CreateTriggerNode. |
private void |
checkInvalidTriggerReference(java.lang.String tableName)
|
private boolean |
equals(java.lang.String left,
java.lang.String right)
|
private void |
forbidActionsOnGenCols()
|
private java.lang.String |
genColumnReferenceSQL(DataDictionary dd,
java.lang.String colName,
java.lang.String tabName,
boolean isOldTable)
|
void |
init(java.lang.Object triggerName,
java.lang.Object tableName,
java.lang.Object triggerEventMask,
java.lang.Object triggerCols,
java.lang.Object isBefore,
java.lang.Object isRow,
java.lang.Object isEnabled,
java.lang.Object refClause,
java.lang.Object whenClause,
java.lang.Object whenText,
java.lang.Object whenOffset,
java.lang.Object actionNode,
java.lang.Object actionText,
java.lang.Object actionOffset)
Initializer for a CreateTriggerNode |
ConstantAction |
makeConstantAction()
Create the Constant information that will drive the guts of Execution. |
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) |
private QueryTreeNode[] |
sortRefs(java.util.Vector refs,
boolean isRow)
|
java.lang.String |
statementToString()
|
java.lang.String |
toString()
Convert this object to a String. |
private void |
validateReferencesClause(DataDictionary dd)
|
Methods inherited from class org.apache.derby.impl.sql.compile.DDLStatementNode |
activationKind, bindName, generate, getFullName, getObjectName, getRelativeName, getSchemaDescriptor, getSchemaDescriptor, getTableDescriptor, getTableDescriptor, getTableDescriptor, getTableDescriptor, init, initAndCheck, isAtomic, makeFromList |
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode |
accept, acceptChildren, bindOffsetFetch, bindRowMultiSet, bindUserType, checkReliability, checkReliability, convertDefaultNode, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, foundString, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContextManager, getCursorInfo, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getNodeFactory, getNodeType, getNullNode, getParameterTypes, getRowEstimate, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, init, init, init, init, init, init, init, init, init, init, init, init, isInstanceOf, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeTableName, makeTableName, nodeHeader, orReliability, parseStatement, printLabel, resolveTableToSynonym, setBeginOffset, setContextManager, setEndOffset, setNodeType, setRefActionInfo, stackPrint, treePrint, treePrint, verifyClassExist |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
triggerName
private TableName triggerName
tableName
private TableName tableName
triggerEventMask
private int triggerEventMask
triggerCols
private ResultColumnList triggerCols
isBefore
private boolean isBefore
isRow
private boolean isRow
isEnabled
private boolean isEnabled
refClause
private java.util.Vector refClause
whenClause
private ValueNode whenClause
whenText
private java.lang.String whenText
whenOffset
private int whenOffset
actionNode
private StatementNode actionNode
actionText
private java.lang.String actionText
originalActionText
private java.lang.String originalActionText
actionOffset
private int actionOffset
triggerSchemaDescriptor
private SchemaDescriptor triggerSchemaDescriptor
compSchemaDescriptor
private SchemaDescriptor compSchemaDescriptor
referencedColInts
private int[] referencedColInts
triggerTableDescriptor
private TableDescriptor triggerTableDescriptor
actionCompSchemaId
private UUID actionCompSchemaId
oldTableName
private java.lang.String oldTableName
newTableName
private java.lang.String newTableName
oldTableInReferencingClause
private boolean oldTableInReferencingClause
newTableInReferencingClause
private boolean newTableInReferencingClause
CreateTriggerNode
public CreateTriggerNode()
init
public void init(java.lang.Object triggerName,
java.lang.Object tableName,
java.lang.Object triggerEventMask,
java.lang.Object triggerCols,
java.lang.Object isBefore,
java.lang.Object isRow,
java.lang.Object isEnabled,
java.lang.Object refClause,
java.lang.Object whenClause,
java.lang.Object whenText,
java.lang.Object whenOffset,
java.lang.Object actionNode,
java.lang.Object actionText,
java.lang.Object actionOffset)
throws StandardException
- Initializer for a CreateTriggerNode
- Overrides:
init
in class QueryTreeNode
- Parameters:
triggerName
- name of the triggertableName
- name of the table which the trigger is declared upontriggerEventMask
- TriggerDescriptor.TRIGGER_EVENT_XXXtriggerCols
- columns trigger is to fire upon. Valid
for UPDATE case only.isBefore
- is before trigger (false for after)isRow
- true for row trigger, false for statementisEnabled
- true if enabledrefClause
- the referencing clausewhenClause
- the WHEN clause treewhenText
- the text of the WHEN clausewhenOffset
- offset of start of WHEN clauseactionNode
- the trigger action treeactionText
- the text of the trigger actionactionOffset
- offset of start of action clause
- Throws:
StandardException
- Thrown on error
statementToString
public java.lang.String statementToString()
- Specified by:
statementToString
in class StatementNode
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:
printSubNodes
in class QueryTreeNode
- Parameters:
depth
- The depth of this node in the tree
bindStatement
public void bindStatement()
throws StandardException
- Bind this CreateTriggerNode. This means doing any static error
checking that can be done before actually creating the table.
- Overrides:
bindStatement
in class StatementNode
- Throws:
StandardException
- Thrown on error
referencesSessionSchema
public boolean referencesSessionSchema()
throws StandardException
- Return true if the node references SESSION schema tables (temporary or permanent)
- Overrides:
referencesSessionSchema
in class QueryTreeNode
- Returns:
- true if references SESSION schema tables, else false
- Throws:
StandardException
- Thrown on error
bindReferencesClause
private boolean bindReferencesClause(DataDictionary dd)
throws StandardException
- Throws:
StandardException
sortRefs
private QueryTreeNode[] sortRefs(java.util.Vector refs,
boolean isRow)
forbidActionsOnGenCols
private void forbidActionsOnGenCols()
throws StandardException
- Throws:
StandardException
equals
private boolean equals(java.lang.String left,
java.lang.String right)
genColumnReferenceSQL
private java.lang.String genColumnReferenceSQL(DataDictionary dd,
java.lang.String colName,
java.lang.String tabName,
boolean isOldTable)
throws StandardException
- Throws:
StandardException
checkInvalidTriggerReference
private void checkInvalidTriggerReference(java.lang.String tableName)
throws StandardException
- Throws:
StandardException
validateReferencesClause
private void validateReferencesClause(DataDictionary dd)
throws StandardException
- Throws:
StandardException
makeConstantAction
public ConstantAction makeConstantAction()
throws StandardException
- Create the Constant information that will drive the guts of Execution.
- Overrides:
makeConstantAction
in class QueryTreeNode
- Throws:
StandardException
- Thrown on failure
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.
- Overrides:
toString
in class DDLStatementNode
- Returns:
- This object as a String
Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.