Class TriggerEventActivator
- java.lang.Object
-
- org.apache.derby.impl.sql.execute.TriggerEventActivator
-
public class TriggerEventActivator extends java.lang.Object
Responsible for firing a trigger or set of triggers based on an event.
-
-
Field Summary
Fields Modifier and Type Field Description private Activation
activation
private ConnectionContext
cc
private int
dmlType
private GenericTriggerExecutor[][]
executors
private LanguageConnectionContext
lcc
private java.lang.String
statementText
private UUID
tableId
private java.lang.String
tableName
private InternalTriggerExecutionContext
tec
private TriggerInfo
triggerInfo
-
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 void
cleanup()
Clean up and release resources.void
notifyEvent(TriggerEvent event, CursorResultSet brs, CursorResultSet ars, int[] colsReadFromTable)
Handle the given event.(package private) void
reopen()
Reopen the trigger activator.private void
setupExecutors(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 StandardException
Reopen 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 StandardException
Clean up and release resources.- Throws:
StandardException
- on unexpected error
-
-