public final class TriggerObject extends SchemaObject
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_QUEUE_SIZE
The default queue size.
|
AGGREGATE, comment, COMMENT, CONSTANT, CONSTRAINT, database, DOMAIN, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, SYNONYM, TABLE_OR_VIEW, trace, TRIGGER, USERADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS| Constructor and Description |
|---|
TriggerObject(Schema schema,
int id,
java.lang.String name,
Table table) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the trigger.
|
void |
fire(SessionLocal session,
int type,
boolean beforeAction)
Call the trigger class if required.
|
boolean |
fireRow(SessionLocal session,
Table table,
Row oldRow,
Row newRow,
boolean beforeAction,
boolean rollback)
Call the fire method of the user-defined trigger class if required.
|
java.lang.String |
getCreateSQL()
Construct the CREATE ...
|
java.lang.String |
getCreateSQLForCopy(Table targetTable,
java.lang.String quotedName)
Build a SQL statement to re-create the object, or to create a copy of the
object with a different name or referencing a different table
|
int |
getQueueSize() |
Table |
getTable()
Get the table of this trigger.
|
java.lang.String |
getTriggerClassName()
Get the trigger class name.
|
java.lang.String |
getTriggerSource() |
int |
getType()
Get the object type.
|
int |
getTypeMask()
Returns the trigger type.
|
java.lang.StringBuilder |
getTypeNameList(java.lang.StringBuilder builder)
Append the trigger types to the given string builder.
|
boolean |
isBefore()
Check if this is a before trigger.
|
boolean |
isInsteadOf() |
boolean |
isNoWait() |
boolean |
isOnRollback() |
boolean |
isRowBased() |
boolean |
isSelectTrigger()
Check whether this is a select trigger.
|
void |
removeChildrenAndResources(SessionLocal session)
Delete all dependent children objects and resources of this object.
|
void |
setBefore(boolean before) |
void |
setInsteadOf(boolean insteadOf) |
void |
setNoWait(boolean noWait) |
void |
setOnRollback(boolean onRollback) |
void |
setQueueSize(int size) |
void |
setRowBased(boolean rowBased) |
void |
setTriggerClassName(java.lang.String triggerClassName,
boolean force)
Set the trigger class name and load the class if possible.
|
void |
setTriggerSource(java.lang.String source,
boolean force)
Set the trigger source code and compile it if possible.
|
void |
setTypeMask(int typeMask)
Set the trigger type.
|
getSchema, getSQL, getSQL, isHiddencheckRename, getChildren, getComment, getCreateSQLForMeta, getDatabase, getDropSQL, getId, getModificationId, getName, invalidate, isTemporary, isValid, rename, setComment, setModified, setObjectName, setTemporary, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetTraceSQLpublic static final int DEFAULT_QUEUE_SIZE
public void setBefore(boolean before)
public boolean isInsteadOf()
public void setInsteadOf(boolean insteadOf)
public void setTriggerClassName(java.lang.String triggerClassName,
boolean force)
triggerClassName - the name of the trigger classforce - whether exceptions (due to missing class or access rights)
should be ignoredpublic void setTriggerSource(java.lang.String source,
boolean force)
source - the source code of a method returning a Triggerforce - whether exceptions (due to syntax error)
should be ignoredpublic void fire(SessionLocal session, int type, boolean beforeAction)
session - the sessiontype - the trigger typebeforeAction - if this method is called before applying the changespublic boolean fireRow(SessionLocal session, Table table, Row oldRow, Row newRow, boolean beforeAction, boolean rollback)
session - the sessiontable - the tableoldRow - the old rownewRow - the new rowbeforeAction - true if this method is called before the operation is
appliedrollback - when the operation occurred within a rollbackpublic int getTypeMask()
public void setTypeMask(int typeMask)
typeMask - the typepublic void setRowBased(boolean rowBased)
public boolean isRowBased()
public void setQueueSize(int size)
public int getQueueSize()
public void setNoWait(boolean noWait)
public boolean isNoWait()
public void setOnRollback(boolean onRollback)
public boolean isOnRollback()
public java.lang.String getCreateSQLForCopy(Table targetTable, java.lang.String quotedName)
DbObjectgetCreateSQLForCopy in class DbObjecttargetTable - the new tablequotedName - the quoted namepublic java.lang.StringBuilder getTypeNameList(java.lang.StringBuilder builder)
builder - the builderpublic java.lang.String getCreateSQL()
DbObjectgetCreateSQL in class DbObjectpublic int getType()
DbObjectpublic void removeChildrenAndResources(SessionLocal session)
DbObjectremoveChildrenAndResources in class DbObjectsession - the sessionpublic Table getTable()
public boolean isBefore()
public java.lang.String getTriggerClassName()
public java.lang.String getTriggerSource()
public void close()
throws java.sql.SQLException
java.sql.SQLException - on failurepublic boolean isSelectTrigger()