We are dependent on TableDescriptors, SPSDescriptors (for our WHEN clause and our action). Note that we don't strictly need to be dependent on out SPSes because we could just disallow anyone from dropping an sps of type 'T', but to keep dependencies uniform, we'll do be dependent.
We are a provider for DML (PreparedStatements or SPSes) The public methods for this class are:
| Modifier and Type | Field and Description |
|---|---|
| private SPSDescriptor | |
| private UUID | |
| private Timestamp | |
| private int | |
| private UUID | |
| private boolean | |
| private boolean | |
| private boolean | |
| private String | |
| private String | |
| private String | |
| private int[] | |
| private int[] | |
| private boolean | |
| private boolean | |
| private SchemaDescriptor | |
| public static final int | |
| private TableDescriptor | |
| public static final int | |
| public static final int | |
| public static final int | |
| private String | |
| private UUID | |
| private UUID | |
| private String | |
| private SPSDescriptor | |
| private UUID |
| Access | Constructor and Description |
|---|---|
| public | |
| pack-priv | TriggerDescriptor(DataDictionary
the data dictionary dataDictionary, SchemaDescriptor the schema descriptor for this trigger sd, UUID the trigger id id, String the trigger name name, 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 td, UUID the sps id for the when clause (may be null) whenSPSId, UUID the spsid for the trigger action (may be null) actionSPSId, Timestamp when was this trigger created? creationTimestamp, 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 trigger action triggerDefinition, 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 REFERCING clause oldReferencingName, String new referencing table name, if any, that appears in REFERCING clause newReferencingName, String the SQL text of the WHEN clause, or whenClauseText)null
if there is no WHEN clauseConstructor. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public UUID | |
| public SPSDescriptor | Returns: the trigger action spsThe LanguageConnectionContext to use. lcc)Get the trigger action sps from SYSSTATEMENTS. |
| public String | Returns: char The provider's type.Implements org. Get the provider's type. |
| private static Context | |
| public Timestamp | Returns: the time the trigger was createdGet the time that this trigger was created. |
| protected DataDictionary | |
| public DependableFinder | Returns: the stored form of this providerImplements org. Get an object which can be written to disk and which, when read from disk, will find or reconstruct this in-memory Dependable. |
| public String | |
| public String | getDescriptorType()
Overrides org. Each descriptor must identify itself with its type; i.e index, check constraint whatever. |
| public String | Returns: the nameImplements abstract org. Get the trigger name |
| public String | Returns: The new Referencing name, if any, from the REFERENCING clause.Get the new Referencing name, if any, from the REFERENCING clause. |
| public UUID | Returns: The provider's UUIDImplements org. Get the provider's UUID |
| public String | Returns: String The name of this provider.Implements org. Return the name of this Provider. |
| public String | Returns: The old Referencing name, if any, from the REFERENCING clause.Get the old Referencing name, if any, from the REFERENCING clause. |
| public int[] | Returns: the referenced column arrayGet the referenced column array for this trigger, used in "alter table drop column", we get the handle and change it |
| public int[] | Returns: the referenced column arrayGet the referenced column array for the trigger action columns. |
| public boolean | Returns: Whether or not NEW was replaced in the REFERENCING clause.Get whether or not NEW was replaced in the REFERENCING clause. |
| public boolean | Returns: Whether or not OLD was replaced in the REFERENCING clause.Get whether or not OLD was replaced in the REFERENCING clause. |
| public SchemaDescriptor | Returns: the schema descriptorImplements abstract org. Get the triggers schema descriptor |
| private SPSDescriptor | Returns: the requested SPSthe LanguageConnectionContext to use lcc, boolean true if the SPS for the WHEN clause is
requested, false if it is the triggered SQL statementGet the SPS for the triggered SQL statement or the WHEN clause. |
| public TableDescriptor | Returns: the table descripor upon which this trigger is declaredGet the trigger table descriptor |
| public UUID | |
| public String | |
| public int | |
| public int | Returns: the formatID of this classImplements org. Get the formatID which corresponds to this class. |
| public UUID | Returns: the idImplements abstract org. Get the trigger UUID |
| public UUID | |
| public SPSDescriptor | Returns: the sps of the when clausethe LanguageConnectionContext to use lcc)Get the trigger when clause sps |
| public String | Returns: SQL text for the WHEN clause, ornull if there is
no WHEN clauseGet the SQL text of the WHEN clause. |
| public boolean | |
| public boolean | |
| public boolean | |
| public synchronized boolean | Returns: true if the dependent is currently validImplements org. Check that all of the dependent's dependencies are valid. |
| public boolean | Returns: true if it listens to the specified event.TRIGGER_EVENT_XXXX event)Indicate whether this trigger listens for this type of event. |
| public void | makeInvalid(int
The action causing the invalidation action, LanguageConnectionContext the language connection context lcc)Implements org. Mark the dependent as invalid (due to at least one of its dependencies being invalid). |
| public boolean | Returns: true/falsethe type of DML
(StatementType.INSERT|StatementType.UPDATE|StatementType.DELETE) stmtType, int[] the columns modified, or null for all modifiedCols)Does this trigger need to fire on this type of DML? |
| public void | prepareToInvalidate(Provider
the provider p, int The action causing the invalidation action, LanguageConnectionContext the language connection context lcc)Implements org. Prepare to mark the dependent as invalid (due to at least one of its dependencies being invalid). |
| public void | readExternal(ObjectInput
read this. in)Implements java. Read this object from a stream of stored objects. |
| public void | |
| public void | |
| public void | |
| public void | setReferencedColsInTriggerAction(int[] referencedColsInTriggerAction)
Set the referenced column array for trigger actions |
| public String | |
| public void | writeExternal(ObjectOutput
write bytes here. out)Implements java. Write this object to a stream of stored objects. |
| actionSPS | back to summary |
|---|---|
| private SPSDescriptor actionSPS | |
| actionSPSId | back to summary |
|---|---|
| private UUID actionSPSId | |
| creationTimestamp | back to summary |
|---|---|
| private Timestamp creationTimestamp | |
| eventMask | back to summary |
|---|---|
| private int eventMask | |
| id | back to summary |
|---|---|
| private UUID id | |
| isBefore | back to summary |
|---|---|
| private boolean isBefore | |
| isEnabled | back to summary |
|---|---|
| private boolean isEnabled | |
| isRow | back to summary |
|---|---|
| private boolean isRow | |
| name | back to summary |
|---|---|
| private String name | |
| newReferencingName | back to summary |
|---|---|
| private String newReferencingName | |
| oldReferencingName | back to summary |
|---|---|
| private String oldReferencingName | |
| referencedCols | back to summary |
|---|---|
| private int[] referencedCols | |
| referencedColsInTriggerAction | back to summary |
|---|---|
| private int[] referencedColsInTriggerAction | |
| referencingNew | back to summary |
|---|---|
| private boolean referencingNew | |
| referencingOld | back to summary |
|---|---|
| private boolean referencingOld | |
| sd | back to summary |
|---|---|
| private SchemaDescriptor sd | |
| SYSTRIGGERS_STATE_FIELD | back to summary |
|---|---|
| public static final int SYSTRIGGERS_STATE_FIELD | |
| td | back to summary |
|---|---|
| private TableDescriptor td | |
| TRIGGER_EVENT_DELETE | back to summary |
|---|---|
| public static final int TRIGGER_EVENT_DELETE | |
| TRIGGER_EVENT_INSERT | back to summary |
|---|---|
| public static final int TRIGGER_EVENT_INSERT | |
| TRIGGER_EVENT_UPDATE | back to summary |
|---|---|
| public static final int TRIGGER_EVENT_UPDATE | |
| triggerDefinition | back to summary |
|---|---|
| private String triggerDefinition | |
| triggerSchemaId | back to summary |
|---|---|
| private UUID triggerSchemaId | |
| triggerTableId | back to summary |
|---|---|
| private UUID triggerTableId | |
| whenClauseText | back to summary |
|---|---|
| private String whenClauseText | |
| whenSPS | back to summary |
|---|---|
| private SPSDescriptor whenSPS | |
| whenSPSId | back to summary |
|---|---|
| private UUID whenSPSId | |
| TriggerDescriptor | back to summary |
|---|---|
| public TriggerDescriptor() Niladic constructor, for formatable | |
| TriggerDescriptor | back to summary |
|---|---|
| pack-priv TriggerDescriptor(DataDictionary dataDictionary, SchemaDescriptor sd, UUID id, String name, int eventMask, boolean isBefore, boolean isRow, boolean isEnabled, TableDescriptor td, UUID whenSPSId, UUID actionSPSId, Timestamp creationTimestamp, int[] referencedCols, int[] referencedColsInTriggerAction, String triggerDefinition, boolean referencingOld, boolean referencingNew, String oldReferencingName, String newReferencingName, String whenClauseText) Constructor. Used when creating a trigger from SYS.SYSTRIGGERS
| |
| drop | back to summary |
|---|---|
| public void drop(LanguageConnectionContext lcc) throws StandardException | |
| getActionId | back to summary |
|---|---|
| public UUID getActionId() Get the trigger action sps UUID
| |
| getActionSPS | back to summary |
|---|---|
| public SPSDescriptor getActionSPS(LanguageConnectionContext lcc) throws StandardException Get the trigger action sps from SYSSTATEMENTS. If we find that the sps is invalid and the trigger is defined at row level and it has OLD/NEW transient variables through REFERENCES clause, then the sps from SYSSTATEMENTS may not be valid anymore. In such a case, we regenerate the trigger action sql and use that for the sps and update SYSSTATEMENTS using this new sps. This update of SYSSTATEMENTS was introduced with DERBY-4874
| |
| getClassType | back to summary |
|---|---|
| public String getClassType() Implements org. Get the provider's type.
| |
| getContext | back to summary |
|---|---|
| private static Context getContext(final String contextID) Must be private so that user code can't call this entry point. | |
| getCreationTimestamp | back to summary |
|---|---|
| public Timestamp getCreationTimestamp() Get the time that this trigger was created.
| |
| getDataDictionary | back to summary |
|---|---|
| protected DataDictionary getDataDictionary() Overrides org. | |
| getDependableFinder | back to summary |
|---|---|
| public DependableFinder getDependableFinder() Implements org. Doc from org. Get an object which can be written to disk and which, when read from disk, will find or reconstruct this in-memory Dependable.
| |
| getDescriptorName | back to summary |
|---|---|
| public String getDescriptorName() Overrides org.
| |
| getDescriptorType | back to summary |
|---|---|
| public String getDescriptorType() Overrides org. Doc from org. Each descriptor must identify itself with its type; i.e index, check constraint whatever.
| |
| getName | back to summary |
|---|---|
| public String getName() Implements abstract org. Get the trigger name
| |
| getNewReferencingName | back to summary |
|---|---|
| public String getNewReferencingName() Get the new Referencing name, if any, from the REFERENCING clause.
| |
| getObjectID | back to summary |
|---|---|
| public UUID getObjectID() Implements org. Get the provider's UUID
| |
| getObjectName | back to summary |
|---|---|
| public String getObjectName() Implements org. Return the name of this Provider. (Useful for errors.)
| |
| getOldReferencingName | back to summary |
|---|---|
| public String getOldReferencingName() Get the old Referencing name, if any, from the REFERENCING clause.
| |
| getReferencedCols | back to summary |
|---|---|
| public int[] getReferencedCols() Get the referenced column array for this trigger, used in "alter table drop column", we get the handle and change it
| |
| getReferencedColsInTriggerAction | back to summary |
|---|---|
| public int[] getReferencedColsInTriggerAction() Get the referenced column array for the trigger action columns.
| |
| getReferencingNew | back to summary |
|---|---|
| public boolean getReferencingNew() Get whether or not NEW was replaced in the REFERENCING clause.
| |
| getReferencingOld | back to summary |
|---|---|
| public boolean getReferencingOld() Get whether or not OLD was replaced in the REFERENCING clause.
| |
| getSchemaDescriptor | back to summary |
|---|---|
| public SchemaDescriptor getSchemaDescriptor() throws StandardException Implements abstract org. Get the triggers schema descriptor
| |
| getSPS | back to summary |
|---|---|
| private SPSDescriptor getSPS(LanguageConnectionContext lcc, boolean isWhenClause) throws StandardException Get the SPS for the triggered SQL statement or the WHEN clause.
| |
| getTableDescriptor | back to summary |
|---|---|
| public TableDescriptor getTableDescriptor() throws StandardException Get the trigger table descriptor
| |
| getTableId | back to summary |
|---|---|
| public UUID getTableId() | |
| getTriggerDefinition | back to summary |
|---|---|
| public String getTriggerDefinition() Get the original trigger definition.
| |
| getTriggerEventMask | back to summary |
|---|---|
| public int getTriggerEventMask() Get the trigger event mask. Currently, a trigger may only listen for a single event, though it may OR multiple events in the future.
| |
| getTypeFormatId | back to summary |
|---|---|
| public int getTypeFormatId() Implements org. Get the formatID which corresponds to this class.
| |
| getUUID | back to summary |
|---|---|
| public UUID getUUID() Implements abstract org. Get the trigger UUID
| |
| getWhenClauseId | back to summary |
|---|---|
| public UUID getWhenClauseId() Get the trigger when clause sps UUID
| |
| getWhenClauseSPS | back to summary |
|---|---|
| public SPSDescriptor getWhenClauseSPS(LanguageConnectionContext lcc) throws StandardException Get the trigger when clause sps
| |
| getWhenClauseText | back to summary |
|---|---|
| public String getWhenClauseText() Get the SQL text of the WHEN clause.
| |
| isBeforeTrigger | back to summary |
|---|---|
| public boolean isBeforeTrigger() Is this a before trigger
| |
| isEnabled | back to summary |
|---|---|
| public boolean isEnabled() Is this trigger enforced
| |
| isRowTrigger | back to summary |
|---|---|
| public boolean isRowTrigger() Is this a row trigger
| |
| isValid | back to summary |
|---|---|
| public synchronized boolean isValid() Implements org. Check that all of the dependent's dependencies are valid.
| |
| listensForEvent | back to summary |
|---|---|
| public boolean listensForEvent(int event) Indicate whether this trigger listens for this type of event.
| |
| makeInvalid | back to summary |
|---|---|
| public void makeInvalid(int action, LanguageConnectionContext lcc) throws StandardException Implements org. Mark the dependent as invalid (due to at least one of its dependencies being invalid). Always an error for a trigger -- should never have gotten here.
| |
| needsToFire | back to summary |
|---|---|
| public boolean needsToFire(int stmtType, int[] modifiedCols) throws StandardException Does this trigger need to fire on this type of DML?
| |
| prepareToInvalidate | back to summary |
|---|---|
| public void prepareToInvalidate(Provider p, int action, LanguageConnectionContext lcc) throws StandardException Implements org. Prepare to mark the dependent as invalid (due to at least one of its dependencies being invalid).
| |
| readExternal | back to summary |
|---|---|
| public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException Implements java. Read this object from a stream of stored objects.
| |
| setDisabled | back to summary |
|---|---|
| public void setDisabled() Mark this trigger as disabled | |
| setEnabled | back to summary |
|---|---|
| public void setEnabled() Mark this trigger as enforced | |
| setReferencedCols | back to summary |
|---|---|
| public void setReferencedCols(int[] newCols) Update the array of referenced columns | |
| setReferencedColsInTriggerAction | back to summary |
|---|---|
| public void setReferencedColsInTriggerAction(int[] referencedColsInTriggerAction) Set the referenced column array for trigger actions | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| writeExternal | back to summary |
|---|---|
| public void writeExternal(ObjectOutput out) throws IOException Implements java. Write this object to a stream of stored objects.
| |