public class TriggerObject extends SchemaObjectBase
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_QUEUE_SIZE
The default queue size.
|
comment, database, traceAGGREGATE, COMMENT, CONSTANT, CONSTRAINT, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, TABLE_OR_VIEW, TRIGGER, USER, USER_DATATYPE| Constructor and Description |
|---|
TriggerObject(Schema schema,
int id,
String name,
Table table) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkRename()
Check if this object can be renamed.
|
void |
close()
Close the trigger.
|
void |
fire(Session session,
int type,
boolean beforeAction)
Call the trigger class if required.
|
boolean |
fireRow(Session session,
Row oldRow,
Row newRow,
boolean beforeAction,
boolean rollback)
Call the fire method of the user-defined trigger class if required.
|
String |
getCreateSQL()
Build a SQL statement to re-create this object.
|
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
|
String |
getDropSQL()
Build a SQL statement to drop this object.
|
int |
getQueueSize() |
Table |
getTable()
Get the table of this trigger.
|
String |
getTriggerClassName()
Get the trigger class name.
|
int |
getType()
Get the object type.
|
String |
getTypeNameList() |
boolean |
isBefore()
Check if this is a before trigger.
|
boolean |
isNoWait() |
boolean |
isSelectTrigger()
Check whether this is a select trigger.
|
void |
removeChildrenAndResources(Session session)
Remove all dependent objects and free all resources (files, blocks in
files) 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(Session session,
String triggerClassName,
boolean force)
Set the trigger class name and load the class if possible.
|
void |
setTypeMask(int typeMask)
Set the trigger type.
|
getSchema, getSQL, initSchemaObjectBase, isHiddengetChildren, getComment, getDatabase, getId, getModificationId, getName, initDbObjectBase, invalidate, isTemporary, rename, setComment, setModified, setObjectName, setTemporary, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetChildren, getComment, getDatabase, getId, getName, isTemporary, rename, setComment, setTemporarypublic static final int DEFAULT_QUEUE_SIZE
public void setBefore(boolean before)
public void setInsteadOf(boolean insteadOf)
public void setTriggerClassName(Session session, String triggerClassName, boolean force)
session - the sessiontriggerClassName - the name of the trigger classforce - whether exceptions (due to missing class or access rights)
should be ignoredpublic void fire(Session session, int type, boolean beforeAction)
session - the sessiontype - the trigger typebeforeAction - if this method is called before applying the changespublic boolean fireRow(Session session, Row oldRow, Row newRow, boolean beforeAction, boolean rollback)
session - the sessionoldRow - the old rownewRow - the new rowbeforeAction - true if this method is called before the operation is
appliedrollback - when the operation occurred within a rollbackpublic void setTypeMask(int typeMask)
typeMask - the typepublic void setRowBased(boolean rowBased)
public void setQueueSize(int size)
public int getQueueSize()
public void setNoWait(boolean noWait)
public boolean isNoWait()
public void setOnRollback(boolean onRollback)
public String getDropSQL()
DbObjectBasegetDropSQL in interface DbObjectgetDropSQL in class DbObjectBasepublic String getCreateSQLForCopy(Table targetTable, String quotedName)
DbObjecttargetTable - the new tablequotedName - the quoted namepublic String getTypeNameList()
public String getCreateSQL()
DbObjectBasegetCreateSQL in interface DbObjectgetCreateSQL in class DbObjectBasepublic int getType()
DbObjectpublic void removeChildrenAndResources(Session session)
DbObjectBaseremoveChildrenAndResources in interface DbObjectremoveChildrenAndResources in class DbObjectBasesession - the sessionpublic void checkRename()
DbObjectBasecheckRename in interface DbObjectcheckRename in class DbObjectBasepublic Table getTable()
public boolean isBefore()
public String getTriggerClassName()
public void close()
throws SQLException
SQLExceptionpublic boolean isSelectTrigger()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.