public final class TriggerObject extends SchemaObject
| 限定符和类型 | 字段和说明 |
|---|---|
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| 构造器和说明 |
|---|
TriggerObject(Schema schema,
int id,
String name,
Table table) |
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
String |
getCreateSQL()
Construct the CREATE ...
|
String |
getCreateSQLForCopy(Table targetTable,
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.
|
String |
getTriggerClassName()
Get the trigger class name.
|
String |
getTriggerSource() |
int |
getType()
Get the object type.
|
int |
getTypeMask()
Returns the trigger type.
|
StringBuilder |
getTypeNameList(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(String triggerClassName,
boolean force)
Set the trigger class name and load the class if possible.
|
void |
setTriggerSource(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(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(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 String getCreateSQLForCopy(Table targetTable, String quotedName)
DbObjectgetCreateSQLForCopy 在类中 DbObjecttargetTable - the new tablequotedName - the quoted namepublic StringBuilder getTypeNameList(StringBuilder builder)
builder - the builderpublic String getCreateSQL()
DbObjectgetCreateSQL 在类中 DbObjectpublic int getType()
DbObjectpublic void removeChildrenAndResources(SessionLocal session)
DbObjectremoveChildrenAndResources 在类中 DbObjectsession - the sessionpublic Table getTable()
public boolean isBefore()
public String getTriggerClassName()
public String getTriggerSource()
public void close()
throws SQLException
SQLException - on failurepublic boolean isSelectTrigger()
Copyright © 2022. All rights reserved.