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.CreateStatementNode
org.apache.derby.impl.sql.compile.CreateTriggerNode
- All Implemented Interfaces:
- Visitable
- public class CreateTriggerNode
- extends CreateStatementNode
A CreateTriggerNode is the root of a QueryTree
that represents a CREATE TRIGGER
statement.
- Author:
- jamie
Method Summary |
QueryTreeNode |
bind()
Bind this CreateTriggerNode. |
private boolean |
bindReferencesClause(DataDictionary dd)
|
private void |
checkInvalidTriggerReference(java.lang.String tableName)
|
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 |
reparseTriggerText(java.lang.String text)
|
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, getTableDescriptor, getTableDescriptor, getTableDescriptor, init, initAndCheck, isAtomic |
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode |
accept, convertDefaultNode, debugFlush, debugPrint, executeSchemaName, executeStatementName, formatNodeString, foundString, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContextManager, getCursorInfo, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getNodeFactory, getNodeType, getNullNode, getParameterTypes, getRowEstimate, getSchemaDescriptor, getSchemaDescriptor, getSPSName, getStatementType, getTableDescriptor, getTypeCompiler, init, init, init, init, init, init, init, init, init, init, init, init, isInstanceOf, isSessionSchema, isSessionSchema, makeResultDescription, makeTableName, needsSavepoint, nodeHeader, optimize, parseQueryText, printLabel, resolveTableToSynonym, setBeginOffset, setContextManager, setEndOffset, setNodeType, setRefActionInfo, 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 QueryTreeNode 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
- Returns:
- A CreateTriggerNode
- 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
- Returns:
- Nothing
bind
public QueryTreeNode bind()
throws StandardException
- Bind this CreateTriggerNode. This means doing any static error
checking that can be done before actually creating the table.
- Overrides:
bind
in class QueryTreeNode
- Returns:
- The bound query tree
- 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)
reparseTriggerText
private QueryTreeNode reparseTriggerText(java.lang.String text)
throws StandardException
- Throws:
StandardException
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.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.