Class CreateTriggerConstantAction
java.lang.Object
org.apache.derby.impl.sql.execute.DDLConstantAction
org.apache.derby.impl.sql.execute.DDLSingleTableConstantAction
org.apache.derby.impl.sql.execute.CreateTriggerConstantAction
- All Implemented Interfaces:
ConstantAction
This class describes actions that are ALWAYS performed for a
CREATE TRIGGER Statement at Execution time.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate UUID
private String
private int
private boolean
private boolean
private boolean
private String
private String
private String
private final String
private final ProviderInfo[]
private int[]
private int[]
private boolean
private boolean
private UUID
private String
private String
private TableDescriptor
private UUID
private UUID
private String
Fields inherited from class org.apache.derby.impl.sql.execute.DDLSingleTableConstantAction
tableId
Fields inherited from interface org.apache.derby.iapi.sql.execute.ConstantAction
WHEN_MATCHED_THEN_DELETE, WHEN_MATCHED_THEN_UPDATE, WHEN_NOT_MATCHED_THEN_INSERT
-
Constructor Summary
ConstructorsConstructorDescriptionCreateTriggerConstantAction
(String triggerSchemaName, String triggerName, int eventMask, boolean isBefore, boolean isRow, boolean isEnabled, TableDescriptor triggerTable, UUID whenSPSId, String whenText, UUID actionSPSId, String actionText, UUID spsCompSchemaId, int[] referencedCols, int[] referencedColsInTriggerAction, String originalWhenText, String originalActionText, boolean referencingOld, boolean referencingNew, String oldReferencingName, String newReferencingName, ProviderInfo[] providerInfo) Make the ConstantAction for a CREATE TRIGGER statement. -
Method Summary
Modifier and TypeMethodDescriptionprivate SPSDescriptor
createSPS
(LanguageConnectionContext lcc, DataDescriptorGenerator ddg, DataDictionary dd, TransactionController tc, UUID triggerId, SchemaDescriptor sd, UUID spsId, UUID compSchemaId, String text, boolean isWhen, TableDescriptor triggerTable) void
executeConstantAction
(Activation activation) This is the guts of the Execution-time logic for CREATE TRIGGER.private Timestamp
Construct the creation timestamp for the trigger.toString()
Methods inherited from class org.apache.derby.impl.sql.execute.DDLSingleTableConstantAction
dropConglomerate, dropConglomerate, dropConstraint, dropConstraint, dropConstraint, executeConglomReplacement, getConglomReplacementAction, recreateUniqueConstraintBackingIndexAsUniqueWhenNotNull
Methods inherited from class org.apache.derby.impl.sql.execute.DDLConstantAction
addColumnDependencies, adjustUDTDependencies, adjustUDTDependencies, constructToString, getAndCheckSchemaDescriptor, getSchemaDescriptorForCreate, lockTableForDDL, storeConstraintDependenciesOnPrivileges, storeViewTriggerDependenciesOnPrivileges
-
Field Details
-
triggerName
-
triggerSchemaName
-
triggerTable
-
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
-
whenText
-
actionSPSId
-
actionText
-
originalWhenText
-
originalActionText
-
oldReferencingName
-
newReferencingName
-
spsCompSchemaId
-
referencedCols
private int[] referencedCols -
referencedColsInTriggerAction
private int[] referencedColsInTriggerAction -
providerInfo
-
-
Constructor Details
-
CreateTriggerConstantAction
CreateTriggerConstantAction(String triggerSchemaName, String triggerName, int eventMask, boolean isBefore, boolean isRow, boolean isEnabled, TableDescriptor triggerTable, UUID whenSPSId, String whenText, UUID actionSPSId, String actionText, UUID spsCompSchemaId, int[] referencedCols, int[] referencedColsInTriggerAction, String originalWhenText, String originalActionText, boolean referencingOld, boolean referencingNew, String oldReferencingName, String newReferencingName, ProviderInfo[] providerInfo) Make the ConstantAction for a CREATE TRIGGER statement.- Parameters:
triggerSchemaName
- name for the schema that trigger lives in.triggerName
- Name of triggereventMask
- TriggerDescriptor.TRIGGER_EVENT_XXXXisBefore
- is this a before (as opposed to after) triggerisRow
- is this a row trigger or statement triggerisEnabled
- is this trigger enabled or disabledtriggerTable
- the table upon which this trigger is definedwhenSPSId
- 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 actionspsCompSchemaId
- the compilation schema for the action and when spses. If null, will be set to the current default schemareferencedCols
- what columns does this trigger reference (may be null)referencedColsInTriggerAction
- what columns does the trigger action reference through old/new transition variables (may be null)originalWhenText
- The original user text of the WHEN clause (may be null)originalActionText
- The original user text of the trigger actionreferencingOld
- whether or not OLD appears in REFERENCING clausereferencingNew
- whether or not NEW appears in REFERENCING clauseoldReferencingName
- old referencing table name, if any, that appears in REFERENCING clausenewReferencingName
- new referencing table name, if any, that appears in REFERENCING clauseproviderInfo
- array of providers that the trigger depends on
-
-
Method Details
-
executeConstantAction
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:
-
createSPS
private SPSDescriptor createSPS(LanguageConnectionContext lcc, DataDescriptorGenerator ddg, DataDictionary dd, TransactionController tc, UUID triggerId, SchemaDescriptor sd, UUID spsId, UUID compSchemaId, String text, boolean isWhen, TableDescriptor triggerTable) throws StandardException - Throws:
StandardException
-
toString
-
makeCreationTimestamp
Construct the creation timestamp for the trigger. DERBY-5866: Also make sure the creation timestamp is higher than any timestamp on an existing trigger on the same table. Otherwise, the triggers may not fire in the correct order.- Throws:
StandardException
-