|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Trigger
The interface an HSQLDB TRIGGER must implement. The user-supplied class that implements this must have a default constructor.
Field Summary | |
---|---|
static int |
DELETE_AFTER
|
static int |
DELETE_AFTER_ROW
|
static int |
DELETE_BEFORE_ROW
|
static int |
INSERT_AFTER
|
static int |
INSERT_AFTER_ROW
|
static int |
INSERT_BEFORE_ROW
|
static int |
UPDATE_AFTER
|
static int |
UPDATE_AFTER_ROW
|
static int |
UPDATE_BEFORE_ROW
|
Method Summary | |
---|---|
void |
fire(int type,
String trigName,
String tabName,
Object[] oldRow,
Object[] newRow)
The method invoked upon each triggered action. |
Field Detail |
---|
static final int INSERT_AFTER
static final int DELETE_AFTER
static final int UPDATE_AFTER
static final int INSERT_AFTER_ROW
static final int DELETE_AFTER_ROW
static final int UPDATE_AFTER_ROW
static final int INSERT_BEFORE_ROW
static final int DELETE_BEFORE_ROW
static final int UPDATE_BEFORE_ROW
Method Detail |
---|
void fire(int type, String trigName, String tabName, Object[] oldRow, Object[] newRow) throws org.hsqldb.HsqlException
type contains the integer index id for trigger type, e.g. TriggerDef.INSERT_AFTER
For all triggers defined as default FOR EACH STATEMENT both oldRow and newRow are null.
For triggers defined as FOR EACH ROW, the following will apply:
When UPDATE triggers are fired, oldRow contains the existing values of the table row and newRow contains the new values.
For INSERT triggers, oldRow is null and newRow contains the table row to be inserted. For DELETE triggers, newRow is null and oldRow contains the table row to be deleted.
For error conditions, users can construct an HsqlException using one of the static methods of org.hsqldb.error.Error with a predefined SQL State from org.hsqldb.error.ErrorCode.
type
- the type as one of the int values defined in the interfacetrigName
- the name of the triggertabName
- the name of the table upon which the triggered action is
occuringoldRow
- the old rownewRow
- the new row
org.hsqldb.HsqlException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |