|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.h2.engine.DbObjectBase
org.h2.schema.SchemaObjectBase
org.h2.schema.TriggerObject
public class TriggerObject
A trigger is created using the statement CREATE TRIGGER
| Field Summary | |
|---|---|
static int |
DEFAULT_QUEUE_SIZE
The default queue size. |
| Fields inherited from class org.h2.engine.DbObjectBase |
|---|
comment, database, trace |
| Fields inherited from interface org.h2.engine.DbObject |
|---|
AGGREGATE, COMMENT, CONSTANT, CONSTRAINT, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, TABLE_OR_VIEW, TRIGGER, USER, USER_DATATYPE |
| Constructor Summary | |
|---|---|
TriggerObject(Schema schema,
int id,
java.lang.String name,
Table table)
|
|
| Method Summary | |
|---|---|
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. |
java.lang.String |
getCreateSQL()
Build a SQL statement to re-create this object. |
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 |
java.lang.String |
getDropSQL()
Build a SQL statement to drop this object. |
int |
getQueueSize()
|
Table |
getTable()
Get the table of this trigger. |
java.lang.String |
getTriggerClassName()
Get the trigger class name. |
int |
getType()
Get the object type. |
java.lang.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,
java.lang.String triggerClassName,
boolean force)
Set the trigger class name and load the class if possible. |
void |
setTypeMask(int typeMask)
Set the trigger type. |
| Methods inherited from class org.h2.schema.SchemaObjectBase |
|---|
getSchema, getSQL, initSchemaObjectBase, isHidden |
| Methods inherited from class org.h2.engine.DbObjectBase |
|---|
getChildren, getComment, getDatabase, getId, getModificationId, getName, initDbObjectBase, invalidate, isTemporary, rename, setComment, setModified, setObjectName, setTemporary, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.h2.engine.DbObject |
|---|
getChildren, getComment, getDatabase, getId, getName, isTemporary, rename, setComment, setTemporary |
| Field Detail |
|---|
public static final int DEFAULT_QUEUE_SIZE
| Constructor Detail |
|---|
public TriggerObject(Schema schema,
int id,
java.lang.String name,
Table table)
| Method Detail |
|---|
public void setBefore(boolean before)
public void setInsteadOf(boolean insteadOf)
public void setTriggerClassName(Session session,
java.lang.String triggerClassName,
boolean force)
session - the sessiontriggerClassName - the name of the trigger classforce - whether exceptions (due to missing class or access rights)
should be ignored
public void fire(Session session,
int type,
boolean beforeAction)
session - the sessiontype - the trigger typebeforeAction - if this method is called before applying the changes
public 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 rollback
public 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 java.lang.String getDropSQL()
DbObjectBase
getDropSQL in interface DbObjectgetDropSQL in class DbObjectBase
public java.lang.String getCreateSQLForCopy(Table targetTable,
java.lang.String quotedName)
DbObject
targetTable - the new tablequotedName - the quoted name
public java.lang.String getTypeNameList()
public java.lang.String getCreateSQL()
DbObjectBase
getCreateSQL in interface DbObjectgetCreateSQL in class DbObjectBasepublic int getType()
DbObject
public void removeChildrenAndResources(Session session)
DbObjectBase
removeChildrenAndResources in interface DbObjectremoveChildrenAndResources in class DbObjectBasesession - the sessionpublic void checkRename()
DbObjectBase
checkRename in interface DbObjectcheckRename in class DbObjectBasepublic Table getTable()
public boolean isBefore()
public java.lang.String getTriggerClassName()
public void close()
throws java.sql.SQLException
java.sql.SQLExceptionpublic boolean isSelectTrigger()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||