| org.apache.derby.iapi.db.TriggerExecutionContext
All known Subclasses: org.apache.derby.impl.sql.execute.InternalTriggerExecutionContext,
TriggerExecutionContext | public interface TriggerExecutionContext (Code) | | A trigger execution context holds information that is
available from the context of a trigger invocation.
|
Field Summary | |
final public static int | DELETE_EVENT Return value from getEventType() for
a delete trigger. | final public static int | INSERT_EVENT Return value from getEventType() for
an insert trigger. | final public static int | UPDATE_EVENT Return value from getEventType() for
an update trigger. |
Method Summary | |
public String | getEventStatementText() Get the text of the statement that caused the
trigger to fire. | public int | getEventType() Get the type for the event that caused the
trigger to fire.
the event type (e.g. | public String[] | getModifiedColumns() Get the columns that have been modified by the statement
that caused this trigger to fire. | public ResultSet | getNewRow() Like getNewRowSet(), but returns a result set positioned
on the first row of the after (new) result set. | public ResultSet | getNewRowSet() Returns a result set of the new (after) images of the changed rows.
For a row trigger, this result set will have a single row. | public ResultSet | getOldRow() Like getOldRowSet(), but returns a result set positioned
on the first row of the before (old) result set. | public ResultSet | getOldRowSet() Returns a result set of the old (before) images of the changed rows.
For a row trigger, this result set will have a single row. | public UUID | getTargetTableId() Get the target table UUID upon which the
trigger event is declared. | public String | getTargetTableName() Get the target table name upon which the
trigger event is declared. | public boolean | wasColumnModified(String columnName) Find out if a column was changed, by column name. | public boolean | wasColumnModified(int columnNumber) |
DELETE_EVENT | final public static int DELETE_EVENT(Code) | | Return value from getEventType() for
a delete trigger.
|
INSERT_EVENT | final public static int INSERT_EVENT(Code) | | Return value from getEventType() for
an insert trigger.
|
UPDATE_EVENT | final public static int UPDATE_EVENT(Code) | | Return value from getEventType() for
an update trigger.
|
getEventStatementText | public String getEventStatementText()(Code) | | Get the text of the statement that caused the
trigger to fire.
the statement text. |
getEventType | public int getEventType()(Code) | | Get the type for the event that caused the
trigger to fire.
the event type (e.g. UPDATE_EVENT) |
getModifiedColumns | public String[] getModifiedColumns()(Code) | | Get the columns that have been modified by the statement
that caused this trigger to fire. If all columns are
modified, will return null (e.g. for INSERT or DELETE
return null).
an array of Strings |
getNewRow | public ResultSet getNewRow() throws SQLException(Code) | | Like getNewRowSet(), but returns a result set positioned
on the first row of the after (new) result set. Used as a convenience
to get a column for a row trigger. Equivalent to getNewRowSet()
followed by next().
Will return null if the call is inapplicable for the trigger
that is currently executing. For example, will return null if
called during the firing of a DELETE trigger.
the ResultSet positioned on the new row image. Mayreturn null. exception: SQLException - if called after the triggering event hascompleted |
getNewRowSet | public ResultSet getNewRowSet() throws SQLException(Code) | | Returns a result set of the new (after) images of the changed rows.
For a row trigger, this 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).
Will return null if the call is inapplicable for the trigger
that is currently executing. For example, will return null if
called during the firing of a DELETE trigger.
the ResultSet containing after images of the rows changed by the triggering event. May return null. exception: SQLException - if called after the triggering event hascompleted |
getOldRow | public ResultSet getOldRow() throws SQLException(Code) | | Like getOldRowSet(), but returns a result set positioned
on the first row of the before (old) result set. Used as a convenience
to get a column for a row trigger. Equivalent to getOldRowSet()
followed by next().
Will return null if the call is inapplicable for the trigger
that is currently executing. For example, will return null if called
during a the firing of an INSERT trigger.
the ResultSet positioned on the old row image. Mayreturn null. exception: SQLException - if called after the triggering event hascompleted |
getOldRowSet | public ResultSet getOldRowSet() throws SQLException(Code) | | Returns a result set of the old (before) images of the changed rows.
For a row trigger, this 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).
Will return null if the call is inapplicable for the trigger
that is currently executing. For example, will return null if called
during a the firing of an INSERT trigger.
the ResultSet containing before images of the rows changed by the triggering event. May return null. exception: SQLException - if called after the triggering event hascompleted |
getTargetTableId | public UUID getTargetTableId()(Code) | | Get the target table UUID upon which the
trigger event is declared.
the uuid of the target table |
getTargetTableName | public String getTargetTableName()(Code) | | Get the target table name upon which the
trigger event is declared.
the target table |
wasColumnModified | public boolean wasColumnModified(String columnName)(Code) | | Find out if a column was changed, by column name.
Parameters: columnName - the column to check true if the column was modified by this statement.Note that this will always return true for INSERTand DELETE regardless of the column name passed in. |
wasColumnModified | public boolean wasColumnModified(int columnNumber)(Code) | | Find out if a column was changed, by column number
Parameters: columnNumber - the column to check true if the column was modified by this statement.Note that this will always return true for INSERTand DELETE regardless of the column name passed in. |
|
|