public class TriggerObject extends SchemaObjectBase
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_QUEUE_SIZE
The default queue size.
|
comment, database, trace
AGGREGATE, 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, isHidden
getChildren, getComment, getDatabase, getId, getModificationId, getName, initDbObjectBase, invalidate, isTemporary, rename, setComment, setModified, setObjectName, setTemporary, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getChildren, getComment, getDatabase, getId, getName, isTemporary, rename, setComment, setTemporary
public 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()
DbObjectBase
getDropSQL
in interface DbObject
getDropSQL
in class DbObjectBase
public String getCreateSQLForCopy(Table targetTable, String quotedName)
DbObject
targetTable
- the new tablequotedName
- the quoted namepublic String getTypeNameList()
public String getCreateSQL()
DbObjectBase
getCreateSQL
in interface DbObject
getCreateSQL
in class DbObjectBase
public int getType()
DbObject
public void removeChildrenAndResources(Session session)
DbObjectBase
removeChildrenAndResources
in interface DbObject
removeChildrenAndResources
in class DbObjectBase
session
- the sessionpublic void checkRename()
DbObjectBase
checkRename
in interface DbObject
checkRename
in class DbObjectBase
public Table getTable()
public boolean isBefore()
public String getTriggerClassName()
public void close() throws SQLException
SQLException
public boolean isSelectTrigger()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.