Note that it is crucial that cleanup() is called once the DML has completed, cleanup() makes sure that users can't do something invalid on a tec reference that they were holding from when the trigger fired.
| Modifier and Type | Field and Description |
|---|---|
| protected CursorResultSet | |
| protected ExecRow | afterRow
used exclusively for InsertResultSets which have autoincrement columns. |
| private Vector | aiCounters
aiCounters is a vector of AutoincrementCounters used to keep state which might be used by the trigger. |
| private Hashtable | aiHT
aiHT is a hash table of auto increment (key, value) pairs. |
| protected CursorResultSet | |
| protected ConnectionContext | |
| protected boolean | |
| protected int | |
| protected TriggerEvent | |
| protected LanguageConnectionContext | |
| private Vector | |
| protected String | |
| protected UUID | |
| protected String | |
| protected TriggerDescriptor |
| Access | Constructor and Description |
|---|---|
| pack-priv | InternalTriggerExecutionContext(LanguageConnectionContext
the lcc lcc, ConnectionContext cc, String the text of the statement that caused the
trigger to fire. may be null if we are replicating statementText, int dmlType, UUID the UUID of the table upon which the trigger
fired targetTableId, String the name of the table upon which the trigger
fired targetTableName, Vector<AutoincrementCounter> A vector of AutoincrementCounters to keep state
of the ai columns in this insert trigger.a aiCounters)Build a trigger execution context. |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| pack-priv void | |
| pack-priv void | |
| public void | copyHashtableToAIHT(Map<String, Long> from)
Copy a map of auto increment values into the trigger execution context hash table of auto increment values. |
| private void | ensureProperContext()
Make sure that the user isn't trying to get a result set after we have cleaned up. |
| public Long | getAutoincrementValue(String
the fully qualified name of the identity column identity)Implements org. Get the last auto-increment value for the specified column. |
| public String | Returns: the statement textImplements org. Get the text of the statement that caused the trigger to fire. |
| public int | Returns: the event type (e.g. UPDATE_EVENT)Implements org. Get the type for the event that caused the trigger to fire. |
| public ResultSet | Returns: the ResultSet positioned on the new row image.Implements org. Like getAfterResultSet(), but returns a result set positioned on the first row of the before result set. |
| public ResultSet | Returns: the ResultSet containing after images of the rows changed by the triggering event.Implements org. Returns a result set row the new images of the changed rows. |
| public ResultSet | Returns: the ResultSet positioned on the old row image.Implements org. Like getBeforeResultSet(), but returns a result set positioned on the first row of the before result set. |
| public ResultSet | Returns: the ResultSet containing before images of the rows changed by the triggering event.Implements org. Returns a result set row the old images of the changed rows. |
| public UUID | Returns: the uuid of the target tableImplements org. Get the target table UUID upon which the trigger event is declared. |
| public String | Returns: the target tableImplements org. Get the target table name upon which the trigger event is declared. |
| public void | resetAICounters(boolean
if True, reset the AutoincremnetCounter to the
beginning-- used to reset the counters for the
next trigger. If false, reset it to the end--
this sets up the counter appropriately for a
AFTER STATEMENT trigger. begin)Reset Autoincrement counters to the beginning or the end. |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| public String | |
| public void | |
| public void | validateStatement(ConstantAction
the constant action of the action
that we are to validate constantAction)Implements org. Make sure that whatever statement is about to be executed is ok from the context of this trigger. |
| afterResultSet | back to summary |
|---|---|
| protected CursorResultSet afterResultSet | |
| afterRow | back to summary |
|---|---|
| protected ExecRow afterRow used exclusively for InsertResultSets which have autoincrement columns. | |
| aiCounters | back to summary |
|---|---|
| private Vector<AutoincrementCounter> aiCounters aiCounters is a vector of AutoincrementCounters used to keep state which might be used by the trigger. This is only used by Insert triggers-- Delete and Update triggers do not use this variable.
| |
| aiHT | back to summary |
|---|---|
| private Hashtable<String, Long> aiHT aiHT is a hash table of auto increment (key, value) pairs. This is used for auto increment values generated by the trigger.
| |
| beforeResultSet | back to summary |
|---|---|
| protected CursorResultSet beforeResultSet | |
| cc | back to summary |
|---|---|
| protected ConnectionContext cc | |
| cleanupCalled | back to summary |
|---|---|
| protected boolean cleanupCalled | |
| dmlType | back to summary |
|---|---|
| protected int dmlType | |
| event | back to summary |
|---|---|
| protected TriggerEvent event | |
| lcc | back to summary |
|---|---|
| protected LanguageConnectionContext lcc | |
| resultSetVector | back to summary |
|---|---|
private Vector<ResultSet> resultSetVector
| |
| statementText | back to summary |
|---|---|
| protected String statementText | |
| targetTableId | back to summary |
|---|---|
| protected UUID targetTableId | |
| targetTableName | back to summary |
|---|---|
| protected String targetTableName | |
| triggerd | back to summary |
|---|---|
| protected TriggerDescriptor triggerd | |
| InternalTriggerExecutionContext | back to summary |
|---|---|
| pack-priv InternalTriggerExecutionContext(LanguageConnectionContext lcc, ConnectionContext cc, String statementText, int dmlType, UUID targetTableId, String targetTableName, Vector<AutoincrementCounter> aiCounters) throws StandardException Build a trigger execution context. About the only thing of real interest to outside observers is that it pushes itself as the trigger execution context in the lcc. Be sure to call cleanup() when you are done, or you will be flogged like the reprobate that you are.
| |
| cleanup | back to summary |
|---|---|
| protected void cleanup() throws StandardException Cleanup the trigger execution context. MUST be called when the caller is done with the trigger execution context. We go to somewhat exaggerated lengths to free up all our resources here because a user may hold on to a TEC after it is valid, so we clean everything up to be on the safe side.
| |
| clearCurrentTriggerEvent | back to summary |
|---|---|
| pack-priv void clearCurrentTriggerEvent() | |
| clearTrigger | back to summary |
|---|---|
| pack-priv void clearTrigger() throws StandardException | |
| copyHashtableToAIHT | back to summary |
|---|---|
| public void copyHashtableToAIHT(Map<String, Long> from) Copy a map of auto increment values into the trigger execution context hash table of auto increment values.
| |
| ensureProperContext | back to summary |
|---|---|
| private void ensureProperContext() throws SQLException Make sure that the user isn't trying to get a result set after we have cleaned up. | |
| getAutoincrementValue | back to summary |
|---|---|
| public Long getAutoincrementValue(String identity) Implements org. Doc from org. Get the last auto-increment value for the specified column. | |
| getEventStatementText | back to summary |
|---|---|
| public String getEventStatementText() Implements org. Get the text of the statement that caused the trigger to fire.
| |
| getEventType | back to summary |
|---|---|
| public int getEventType() Implements org. Get the type for the event that caused the trigger to fire.
| |
| getNewRow | back to summary |
|---|---|
| public ResultSet getNewRow() throws SQLException Implements org. Like getAfterResultSet(), but returns a result set positioned on the first row of the before result set. Used as a convenience to get a column for a row trigger. Equivalent to getAfterResultSet() followed by next().
| |
| getNewRowSet | back to summary |
|---|---|
| public ResultSet getNewRowSet() throws SQLException Implements org. Returns a result set row the new images of the changed rows. For a row trigger, the result set will have a single row. For a statement trigger, this result set has every row that has changed or will change. If a statement trigger does not affect a row, then the result set will be empty (i.e. ResultSet.next() will return false).
| |
| getOldRow | back to summary |
|---|---|
| public ResultSet getOldRow() throws SQLException Implements org. Like getBeforeResultSet(), but returns a result set positioned on the first row of the before result set. Used as a convenience to get a column for a row trigger. Equivalent to getBeforeResultSet() followed by next().
| |
| getOldRowSet | back to summary |
|---|---|
| public ResultSet getOldRowSet() throws SQLException Implements org. Returns a result set row the old images of the changed rows. For a row trigger, the result set will have a single row. For a statement trigger, this result set has every row that has changed or will change. If a statement trigger does not affect a row, then the result set will be empty (i.e. ResultSet.next() will return false).
| |
| getTargetTableId | back to summary |
|---|---|
| public UUID getTargetTableId() Implements org. Get the target table UUID upon which the trigger event is declared.
| |
| getTargetTableName | back to summary |
|---|---|
| public String getTargetTableName() Implements org. Get the target table name upon which the trigger event is declared.
| |
| resetAICounters | back to summary |
|---|---|
| public void resetAICounters(boolean begin) Reset Autoincrement counters to the beginning or the end.
| |
| setAfterResultSet | back to summary |
|---|---|
| pack-priv void setAfterResultSet(CursorResultSet rs) throws StandardException | |
| setBeforeResultSet | back to summary |
|---|---|
| pack-priv void setBeforeResultSet(CursorResultSet rs) | |
| setCurrentTriggerEvent | back to summary |
|---|---|
| pack-priv void setCurrentTriggerEvent(TriggerEvent event) | |
| setTrigger | back to summary |
|---|---|
| pack-priv void setTrigger(TriggerDescriptor triggerd) | |
| 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- | |
| updateAICounters | back to summary |
|---|---|
| public void updateAICounters() throws StandardException Update auto increment counters from the last row inserted. | |
| validateStatement | back to summary |
|---|---|
| public void validateStatement(ConstantAction constantAction) throws StandardException Implements org. Make sure that whatever statement is about to be executed is ok from the context of this trigger. Note that we are sub classed in replication for checks for replication specific language.
| |