abstract class GenericTriggerExecutor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private SPSDescriptor |
action |
private ExecPreparedStatement |
actionPS |
private boolean |
actionRetrieved |
(package private) Activation |
activation |
private LanguageConnectionContext |
lcc |
private Activation |
spsActionActivation |
private Activation |
spsWhenActivation |
(package private) InternalTriggerExecutionContext |
tec |
(package private) TriggerDescriptor |
triggerd |
private SPSDescriptor |
whenClause |
private boolean |
whenClauseRetrieved |
private ExecPreparedStatement |
whenPS |
Constructor and Description |
---|
GenericTriggerExecutor(InternalTriggerExecutionContext tec,
TriggerDescriptor triggerd,
Activation activation,
LanguageConnectionContext lcc)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
clearSPS()
Cleanup after executing the SPS for the WHEN clause and trigger action.
|
private boolean |
executeSPS(SPSDescriptor sps,
boolean isWhen)
Execute the given stored prepared statement.
|
(package private) void |
executeWhenClauseAndAction()
Execute the WHEN clause SPS and the trigger action SPS.
|
(package private) abstract void |
fireTrigger(TriggerEvent event,
CursorResultSet brs,
CursorResultSet ars,
int[] colsReadFromTable)
Fire the trigger based on the event.
|
private SPSDescriptor |
getAction() |
private SPSDescriptor |
getWhenClause() |
final InternalTriggerExecutionContext tec
final TriggerDescriptor triggerd
final Activation activation
private final LanguageConnectionContext lcc
private boolean whenClauseRetrieved
private boolean actionRetrieved
private SPSDescriptor whenClause
private SPSDescriptor action
private ExecPreparedStatement whenPS
private Activation spsWhenActivation
private ExecPreparedStatement actionPS
private Activation spsActionActivation
GenericTriggerExecutor(InternalTriggerExecutionContext tec, TriggerDescriptor triggerd, Activation activation, LanguageConnectionContext lcc)
tec
- the execution contexttriggerd
- the trigger descriptoractivation
- the activationlcc
- the lccabstract void fireTrigger(TriggerEvent event, CursorResultSet brs, CursorResultSet ars, int[] colsReadFromTable) throws StandardException
event
- the trigger eventbrs
- the before result setars
- the after result setcolsReadFromTable
- columns required from the trigger table
by the triggering sqlStandardException
- on error or user exception
from trigger actionprivate SPSDescriptor getWhenClause() throws StandardException
StandardException
private SPSDescriptor getAction() throws StandardException
StandardException
private boolean executeSPS(SPSDescriptor sps, boolean isWhen) throws StandardException
sps
- the SPS to executeisWhen
- true
if the SPS is for the WHEN clause,
false
otherwisetrue
if the SPS is for a WHEN clause and it evaluated
to TRUE
, false
otherwiseStandardException
- on errorprotected void clearSPS() throws StandardException
StandardException
- on errorfinal void executeWhenClauseAndAction() throws StandardException
Execute the WHEN clause SPS and the trigger action SPS.
If there is no WHEN clause, the trigger action should always be executed. If there is a WHEN clause, the trigger action should only be executed if the WHEN clause returns TRUE.
StandardException
- if trigger execution failsApache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.