Class Hierarchy        Index

Interface COM.cloudscape.database.TriggerExecutionContext

public interface TriggerExecutionContext
Copyright © 1998-1999, Cloudscape, Inc. All rights reserved.

A trigger execution context holds information that is available from the context of a trigger invocation.

Cloudscape reserves the right to change, rename, or remove this interface at any time.


Variable Index

 o DELETE_EVENT
 o INSERT_EVENT
 o UPDATE_EVENT

Method Index

 o getEventStatementText()
Get the text of the statement that caused the trigger to fire.
 o getEventType()
Get the type for the event that caused the trigger to fire.
 o getModifiedColumns()
Get the columns that have been modified by the statement that caused this trigger to fire.
 o getNewRow()
Like getNewRowSet(), but returns a result set positioned on the first row of the after (new) result set.
 o getNewRowSet()
Returns a result set of the new (after) images of the changed rows.
 o getOldRow()
Like getOldRowSet(), but returns a result set positioned on the first row of the before (old) result set.
 o getOldRowSet()
Returns a result set of the old (before) images of the changed rows.
 o getTargetTableId()
Get the target table UUID upon which the trigger event is declared.
 o getTargetTableName()
Get the target table name upon which the trigger event is declared.
 o wasColumnModified(int)
Find out if a column was changed, by column number
 o wasColumnModified(String)
Find out if a column was changed, by column name.

Variables

 o UPDATE_EVENT
 public static final int UPDATE_EVENT
 o DELETE_EVENT
 public static final int DELETE_EVENT
 o INSERT_EVENT
 public static final int INSERT_EVENT

Methods

 o getTargetTableName
 public abstract String getTargetTableName()
Get the target table name upon which the trigger event is declared.

Returns:
the target table
 o getTargetTableId
 public abstract UUID getTargetTableId()
Get the target table UUID upon which the trigger event is declared.

Returns:
the uuid of the target table
 o getEventType
 public abstract int getEventType()
Get the type for the event that caused the trigger to fire.

Returns:
the event type (e.g. UPDATE_EVENT)
 o getEventStatementText
 public abstract String getEventStatementText()
Get the text of the statement that caused the trigger to fire. For a trigger that is firing on a synchronization source as a result of a target refresh, this will return null.

Returns:
the statement text, or null for a trigger that is firing on a synchronization source due to a target refresh.
 o getModifiedColumns
 public abstract String[] getModifiedColumns()
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).

Returns:
an array of Strings
 o wasColumnModified
 public abstract boolean wasColumnModified(String columnName)
Find out if a column was changed, by column name.

Parameters:
columnName - the column to check
Returns:
true if the column was modified by this statement. Note that this will always return true for INSERT and DELETE regardless of the column name passed in.
 o wasColumnModified
 public abstract boolean wasColumnModified(int columnNumber)
Find out if a column was changed, by column number

Parameters:
columnNumber - the column to check
Returns:
true if the column was modified by this statement. Note that this will always return true for INSERT and DELETE regardless of the column name passed in.
 o getOldRowSet
 public abstract ResultSet getOldRowSet() throws DatabaseException
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).

Returns:
the ResultSet containing before images of the rows changed by the triggering event.
Throws: DatabaseException
if called after the triggering event has completed
 o getNewRowSet
 public abstract ResultSet getNewRowSet() throws DatabaseException
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).

Returns:
the ResultSet containing after images of the rows changed by the triggering event.
Throws: DatabaseException
if called after the triggering event has completed
 o getOldRow
 public abstract ResultSet getOldRow() throws DatabaseException
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().

Returns:
the ResultSet positioned on the old row image.
Throws: DatabaseException
if called after the triggering event has completed
 o getNewRow
 public abstract ResultSet getNewRow() throws DatabaseException
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().

Returns:
the ResultSet positioned on the new row image.
Throws: DatabaseException
if called after the triggering event has completed

  Class Hierarchy        Index