|
||||||||||
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,
boolean beforeAction)
Call the trigger class if required. |
void |
fireRow(Session session,
Row oldRow,
Row newRow,
boolean beforeAction)
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 table,
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()
|
void |
removeChildrenAndResources(Session session)
Remove all dependent objects and free all resources (files, blocks in files) of this object. |
void |
setBefore(boolean before)
|
void |
setNoWait(boolean noWait)
|
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 |
Methods inherited from class org.h2.engine.DbObjectBase |
---|
getChildren, getComment, getDatabase, getHeadPos, 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, getHeadPos, getId, getModificationId, getName, isTemporary, rename, setComment, setModified, 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 setTriggerClassName(Session session, java.lang.String triggerClassName, boolean force) throws java.sql.SQLException
session
- the sessiontriggerClassName
- the name of the trigger classforce
- whether exceptions (due to missing class or access rights)
should be ignored
java.sql.SQLException
public void fire(Session session, boolean beforeAction) throws java.sql.SQLException
session
- the sessionbeforeAction
- if this method is called before applying the changes
java.sql.SQLException
public void fireRow(Session session, Row oldRow, Row newRow, boolean beforeAction) throws java.sql.SQLException
session
- the sessionoldRow
- the old rownewRow
- the new rowbeforeAction
- true if this method is called before the operation is
applied
java.sql.SQLException
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 java.lang.String getDropSQL()
DbObjectBase
getDropSQL
in interface DbObject
getDropSQL
in class DbObjectBase
public java.lang.String getCreateSQLForCopy(Table table, java.lang.String quotedName)
DbObjectBase
getCreateSQLForCopy
in interface DbObject
getCreateSQLForCopy
in class DbObjectBase
table
- the new table namequotedName
- the new quoted name
public java.lang.String getTypeNameList()
public java.lang.String getCreateSQL()
DbObjectBase
getCreateSQL
in interface DbObject
getCreateSQL
in class DbObjectBase
public int getType()
DbObjectBase
getType
in interface DbObject
getType
in class DbObjectBase
public void removeChildrenAndResources(Session session) throws java.sql.SQLException
DbObjectBase
removeChildrenAndResources
in interface DbObject
removeChildrenAndResources
in class DbObjectBase
session
- the session
java.sql.SQLException
public void checkRename()
DbObjectBase
checkRename
in interface DbObject
checkRename
in class DbObjectBase
public Table getTable()
public boolean isBefore()
public java.lang.String getTriggerClassName()
public void close() throws java.sql.SQLException
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |