Class TriggerEventActivator
- java.lang.Object
-
- org.apache.derby.impl.sql.execute.TriggerEventActivator
-
public class TriggerEventActivator extends java.lang.ObjectResponsible for firing a trigger or set of triggers based on an event.
-
-
Field Summary
Fields Modifier and Type Field Description private Activationactivationprivate ConnectionContextccprivate intdmlTypeprivate GenericTriggerExecutor[][]executorsprivate LanguageConnectionContextlccprivate java.lang.StringstatementTextprivate UUIDtableIdprivate java.lang.StringtableNameprivate InternalTriggerExecutionContexttecprivate TriggerInfotriggerInfo
-
Constructor Summary
Constructors Constructor Description TriggerEventActivator(LanguageConnectionContext lcc, UUID tableId, TriggerInfo triggerInfo, int dmlType, Activation activation, java.util.Vector<AutoincrementCounter> aiCounters)Basic constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanup()Clean up and release resources.voidnotifyEvent(TriggerEvent event, CursorResultSet brs, CursorResultSet ars, int[] colsReadFromTable)Handle the given event.(package private) voidreopen()Reopen the trigger activator.private voidsetupExecutors(TriggerInfo triggerInfo)
-
-
-
Field Detail
-
lcc
private LanguageConnectionContext lcc
-
triggerInfo
private TriggerInfo triggerInfo
-
tec
private InternalTriggerExecutionContext tec
-
executors
private GenericTriggerExecutor[][] executors
-
activation
private Activation activation
-
cc
private ConnectionContext cc
-
statementText
private java.lang.String statementText
-
dmlType
private int dmlType
-
tableId
private UUID tableId
-
tableName
private java.lang.String tableName
-
-
Constructor Detail
-
TriggerEventActivator
public TriggerEventActivator(LanguageConnectionContext lcc, UUID tableId, TriggerInfo triggerInfo, int dmlType, Activation activation, java.util.Vector<AutoincrementCounter> aiCounters) throws StandardException
Basic constructor- Parameters:
lcc- the lcctriggerInfo- the trigger informationdmlType- Type of DML for which this trigger is being fired.activation- the activation.aiCounters- vector of ai counters- Throws:
StandardException- on error
-
-
Method Detail
-
reopen
void reopen() throws StandardExceptionReopen the trigger activator. Just creates a new trigger execution context. Note that close() still must be called when you are done -- you cannot just do a reopen() w/o a first doing a close.- Throws:
StandardException- on error
-
setupExecutors
private void setupExecutors(TriggerInfo triggerInfo) throws StandardException
- Throws:
StandardException
-
notifyEvent
public void notifyEvent(TriggerEvent event, CursorResultSet brs, CursorResultSet ars, int[] colsReadFromTable) throws StandardException
Handle the given event.- Parameters:
event- a trigger eventbrs- the before result set. Typically a TemporaryRowHolderResultSet but sometimes a BulkTableScanResultSetars- the after result set. Typically a TemporaryRowHolderResultSet but sometimes a BulkTableScanResultSetcolsReadFromTable- columns required from the trigger table by the triggering sql- Throws:
StandardException- on error
-
cleanup
public void cleanup() throws StandardExceptionClean up and release resources.- Throws:
StandardException- on unexpected error
-
-