Top Description Fields Constructors Methods
org.apache.derby.impl.sql.execute

pack-priv Class CreateTriggerConstantAction

extends DDLSingleTableConstantAction
Class Inheritance
Imports
org.apache.derby.iapi.services.property.PropertyUtil, org.apache.derby.iapi.store.access.TransactionController, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, org.apache.derby.iapi.sql.execute.ConstantAction, org.apache.derby.iapi.sql.dictionary.DataDescriptorGenerator, .DataDictionary, .SchemaDescriptor, .SPSDescriptor, .TableDescriptor, .TriggerDescriptor, .TriggerDescriptorList, org.apache.derby.iapi.sql.depend.DependencyManager, .Provider, .ProviderInfo, org.apache.derby.iapi.sql.Activation, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.SQLState, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.catalog.UUID, java.sql.Timestamp

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

Field Summary

Modifier and TypeField and Description
private 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
Inherited from org.apache.derby.impl.sql.execute.DDLSingleTableConstantAction:
tableId

Constructor Summary

AccessConstructor and Description
pack-priv
CreateTriggerConstantAction(String
name for the schema that trigger lives in.
triggerSchemaName
,
String
Name of trigger
triggerName
,
int
TriggerDescriptor.TRIGGER_EVENT_XXXX
eventMask
,
boolean
is this a before (as opposed to after) trigger
isBefore
,
boolean
is this a row trigger or statement trigger
isRow
,
boolean
is this trigger enabled or disabled
isEnabled
,
TableDescriptor
the table upon which this trigger is defined
triggerTable
,
UUID
the sps id for the when clause (may be null)
whenSPSId
,
String
the text of the when clause (may be null)
whenText
,
UUID
the spsid for the trigger action (may be null)
actionSPSId
,
String
the text of the trigger action
actionText
,
UUID
the compilation schema for the action and when spses. If null, will be set to the current default schema
spsCompSchemaId
,
int[]
what columns does this trigger reference (may be null)
referencedCols
,
int[]
what columns does the trigger action reference through old/new transition variables (may be null)
referencedColsInTriggerAction
,
String
The original user text of the WHEN clause (may be null)
originalWhenText
,
String
The original user text of the trigger action
originalActionText
,
boolean
whether or not OLD appears in REFERENCING clause
referencingOld
,
boolean
whether or not NEW appears in REFERENCING clause
referencingNew
,
String
old referencing table name, if any, that appears in REFERENCING clause
oldReferencingName
,
String
new referencing table name, if any, that appears in REFERENCING clause
newReferencingName
,
ProviderInfo[]
array of providers that the trigger depends on
providerInfo
)

Make the ConstantAction for a CREATE TRIGGER statement.

Method Summary

Modifier and TypeMethod and Description
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)

public void
executeConstantAction(Activation
The execution environment for this constant action.
activation
)

Implements org.apache.derby.iapi.sql.execute.ConstantAction.executeConstantAction.

This is the guts of the Execution-time logic for CREATE TRIGGER.

private Timestamp
makeCreationTimestamp(DataDictionary dd)

Construct the creation timestamp for the trigger.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.apache.derby.impl.sql.execute.DDLSingleTableConstantAction:
dropConglomeratedropConglomeratedropConstraintdropConstraintdropConstraintexecuteConglomReplacementgetConglomReplacementActionrecreateUniqueConstraintBackingIndexAsUniqueWhenNotNull

Field Detail

actionSPSIdback to summary
private UUID actionSPSId
actionTextback to summary
private String actionText
eventMaskback to summary
private int eventMask
isBeforeback to summary
private boolean isBefore
isEnabledback to summary
private boolean isEnabled
isRowback to summary
private boolean isRow
newReferencingNameback to summary
private String newReferencingName
oldReferencingNameback to summary
private String oldReferencingName
originalActionTextback to summary
private String originalActionText
originalWhenTextback to summary
private final String originalWhenText
providerInfoback to summary
private final ProviderInfo[] providerInfo
referencedColsback to summary
private int[] referencedCols
referencedColsInTriggerActionback to summary
private int[] referencedColsInTriggerAction
referencingNewback to summary
private boolean referencingNew
referencingOldback to summary
private boolean referencingOld
spsCompSchemaIdback to summary
private UUID spsCompSchemaId
triggerNameback to summary
private String triggerName
triggerSchemaNameback to summary
private String triggerSchemaName
triggerTableback to summary
private TableDescriptor triggerTable
triggerTableIdback to summary
private UUID triggerTableId
whenSPSIdback to summary
private UUID whenSPSId
whenTextback to summary
private String whenText

Constructor Detail

CreateTriggerConstantActionback to summary
pack-priv 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:String

name for the schema that trigger lives in.

triggerName:String

Name of trigger

eventMask:int

TriggerDescriptor.TRIGGER_EVENT_XXXX

isBefore:boolean

is this a before (as opposed to after) trigger

isRow:boolean

is this a row trigger or statement trigger

isEnabled:boolean

is this trigger enabled or disabled

triggerTable:TableDescriptor

the table upon which this trigger is defined

whenSPSId:UUID

the sps id for the when clause (may be null)

whenText:String

the text of the when clause (may be null)

actionSPSId:UUID

the spsid for the trigger action (may be null)

actionText:String

the text of the trigger action

spsCompSchemaId:UUID

the compilation schema for the action and when spses. If null, will be set to the current default schema

referencedCols:int[]

what columns does this trigger reference (may be null)

referencedColsInTriggerAction:int[]

what columns does the trigger action reference through old/new transition variables (may be null)

originalWhenText:String

The original user text of the WHEN clause (may be null)

originalActionText:String

The original user text of the trigger action

referencingOld:boolean

whether or not OLD appears in REFERENCING clause

referencingNew:boolean

whether or not NEW appears in REFERENCING clause

oldReferencingName:String

old referencing table name, if any, that appears in REFERENCING clause

newReferencingName:String

new referencing table name, if any, that appears in REFERENCING clause

providerInfo:ProviderInfo[]

array of providers that the trigger depends on

Method Detail

createSPSback to summary
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
executeConstantActionback to summary
public void executeConstantAction(Activation activation) throws StandardException

Implements org.apache.derby.iapi.sql.execute.ConstantAction.executeConstantAction.

This is the guts of the Execution-time logic for CREATE TRIGGER.

Parameters
activation:Activation

Doc from org.apache.derby.iapi.sql.execute.ConstantAction.executeConstantAction.

The execution environment for this constant action.

Exceptions
StandardException:
Thrown on failure
See Also
ConstantAction#executeConstantAction
makeCreationTimestampback to summary
private Timestamp makeCreationTimestamp(DataDictionary dd) throws StandardException

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.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object