org.apache.derby.impl.sql.execute
Class CreateTriggerConstantAction

java.lang.Object
  extended byorg.apache.derby.impl.sql.execute.GenericConstantAction
      extended byorg.apache.derby.impl.sql.execute.DDLConstantAction
          extended byorg.apache.derby.impl.sql.execute.DDLSingleTableConstantAction
              extended byorg.apache.derby.impl.sql.execute.CreateTriggerConstantAction
All Implemented Interfaces:
ConstantAction

class CreateTriggerConstantAction
extends DDLSingleTableConstantAction

This class describes actions that are ALWAYS performed for a CREATE TRIGGER Statement at Execution time.

Author:
Jamie

Field Summary
private  UUID actionSPSId
           
private  java.lang.String actionText
           
private  java.sql.Timestamp creationTimestamp
           
private  int eventMask
           
private  boolean isBefore
           
private  boolean isEnabled
           
private  boolean isRow
           
private  java.lang.String newReferencingName
           
private  java.lang.String oldReferencingName
           
private  java.lang.String originalActionText
           
private  int[] referencedCols
           
private  boolean referencingNew
           
private  boolean referencingOld
           
private  UUID spsCompSchemaId
           
protected  UUID tableId
           
private  java.lang.String triggerName
           
private  java.lang.String triggerSchemaName
           
private  TableDescriptor triggerTable
           
private  UUID triggerTableId
           
private  UUID whenSPSId
           
private  java.lang.String whenText
           
 
Fields inherited from interface org.apache.derby.iapi.sql.execute.ConstantAction
RUNTIMESTATISTICS, STATISTICSTIMING
 
Constructor Summary
(package private) CreateTriggerConstantAction(java.lang.String triggerSchemaName, java.lang.String triggerName, int eventMask, boolean isBefore, boolean isRow, boolean isEnabled, TableDescriptor triggerTable, UUID whenSPSId, java.lang.String whenText, UUID actionSPSId, java.lang.String actionText, UUID spsCompSchemaId, java.sql.Timestamp creationTimestamp, int[] referencedCols, java.lang.String originalActionText, boolean referencingOld, boolean referencingNew, java.lang.String oldReferencingName, java.lang.String newReferencingName)
          Make the ConstantAction for a CREATE TRIGGER statement.
 
Method Summary
private  SPSDescriptor createSPS(LanguageConnectionContext lcc, DataDescriptorGenerator ddg, DataDictionary dd, TransactionController tc, UUID triggerId, SchemaDescriptor sd, UUID spsId, UUID compSchemaId, java.lang.String text, boolean isWhen, TableDescriptor triggerTable)
           
 void executeConstantAction(Activation activation)
          This is the guts of the Execution-time logic for CREATE TRIGGER.
 boolean modifiesTableId(UUID tableId)
          Does this constant action modify the passed in table uuid?
 java.lang.String toString()
           
 
Methods inherited from class org.apache.derby.impl.sql.execute.DDLConstantAction
constructToString, getAndCheckSchemaDescriptor, getSchemaDescriptorForCreate, lockTableForDDL, readExternal, upToDate, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

triggerName

private java.lang.String triggerName

triggerSchemaName

private java.lang.String triggerSchemaName

triggerTable

private TableDescriptor triggerTable

triggerTableId

private UUID triggerTableId

eventMask

private int eventMask

isBefore

private boolean isBefore

isRow

private boolean isRow

isEnabled

private boolean isEnabled

referencingOld

private boolean referencingOld

referencingNew

private boolean referencingNew

whenSPSId

private UUID whenSPSId

whenText

private java.lang.String whenText

actionSPSId

private UUID actionSPSId

actionText

private java.lang.String actionText

originalActionText

private java.lang.String originalActionText

oldReferencingName

private java.lang.String oldReferencingName

newReferencingName

private java.lang.String newReferencingName

spsCompSchemaId

private UUID spsCompSchemaId

creationTimestamp

private java.sql.Timestamp creationTimestamp

referencedCols

private int[] referencedCols

tableId

protected UUID tableId
Constructor Detail

CreateTriggerConstantAction

CreateTriggerConstantAction(java.lang.String triggerSchemaName,
                            java.lang.String triggerName,
                            int eventMask,
                            boolean isBefore,
                            boolean isRow,
                            boolean isEnabled,
                            TableDescriptor triggerTable,
                            UUID whenSPSId,
                            java.lang.String whenText,
                            UUID actionSPSId,
                            java.lang.String actionText,
                            UUID spsCompSchemaId,
                            java.sql.Timestamp creationTimestamp,
                            int[] referencedCols,
                            java.lang.String originalActionText,
                            boolean referencingOld,
                            boolean referencingNew,
                            java.lang.String oldReferencingName,
                            java.lang.String newReferencingName)
Make the ConstantAction for a CREATE TRIGGER statement.

Parameters:
triggerSchemaName - name for the schema that trigger lives in.
triggerName - Name of trigger
eventMask - TriggerDescriptor.TRIGGER_EVENT_XXXX
isBefore - is this a before (as opposed to after) trigger
isRow - is this a row trigger or statement trigger
isEnabled - is this trigger enabled or disabled
triggerTable - the table upon which this trigger is defined
whenSPSId - the sps id for the when clause (may be null)
whenText - the text of the when clause (may be null)
actionSPSId - the spsid for the trigger action (may be null)
actionText - the text of the trigger action
spsCompSchemaId - the compilation schema for the action and when spses. If null, will be set to the current default schema
creationTimestamp - when was this trigger created? if null, will be set to the time that executeConstantAction() is invoked
referencedCols - what columns does this trigger reference (may be null)
originalActionText - The original user text of the trigger action
referencingOld - whether or not OLD appears in REFERENCING clause
referencingNew - whether or not NEW appears in REFERENCING clause
oldReferencingName - old referencing table name, if any, that appears in REFERENCING clause
newReferencingName - new referencing table name, if any, that appears in REFERENCING clause
Method Detail

executeConstantAction

public void executeConstantAction(Activation activation)
                           throws StandardException
This is the guts of the Execution-time logic for CREATE TRIGGER.

Parameters:
activation - The execution environment for this constant action.
Throws:
StandardException - Thrown on failure
See Also:
ConstantAction.executeConstantAction(org.apache.derby.iapi.sql.Activation)

createSPS

private SPSDescriptor createSPS(LanguageConnectionContext lcc,
                                DataDescriptorGenerator ddg,
                                DataDictionary dd,
                                TransactionController tc,
                                UUID triggerId,
                                SchemaDescriptor sd,
                                UUID spsId,
                                UUID compSchemaId,
                                java.lang.String text,
                                boolean isWhen,
                                TableDescriptor triggerTable)
                         throws StandardException
Throws:
StandardException

toString

public java.lang.String toString()

modifiesTableId

public boolean modifiesTableId(UUID tableId)
Does this constant action modify the passed in table uuid? By modify we mean add or drop things tied to this table (e.g. index, trigger, constraint). Things like views or spses that reference this table don't count.

Specified by:
modifiesTableId in interface ConstantAction
Overrides:
modifiesTableId in class DDLConstantAction
Parameters:
tableId - the table id


Apache Derby V10.0 Engine Documentation - Copyright © 1997,2004 The Apache Software Foundation or its licensors, as applicable.