org.hsqldb
Class TriggerDef
- java.lang.Object
-
- org.hsqldb.TriggerDef
-
- All Implemented Interfaces:
- java.lang.Runnable, SchemaObject
- Direct Known Subclasses:
- TriggerDefSQL
public class TriggerDef extends java.lang.Object implements java.lang.Runnable, SchemaObject
Represents an HSQLDB Trigger definition.Provides services regarding HSQLDB Trigger execution and metadata.
Development of the trigger implementation sponsored by Logicscope Realisations Ltd
- Since:
- hsqldb 1.61
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hsqldb.SchemaObject
SchemaObject.ConstraintTypes, SchemaObject.Deferable, SchemaObject.Nullability, SchemaObject.ParameterModes, SchemaObject.ReferentialAction, SchemaObject.ViewCheckModes
-
-
Field Summary
-
Fields inherited from interface org.hsqldb.SchemaObject
ASSERTION, CATALOG, CHARSET, COLLATION, COLUMN, CONSTRAINT, CURSOR, DOMAIN, FUNCTION, GRANTEE, INDEX, LABEL, PARAMETER, PROCEDURE, ROUTINE, SCHEMA, SEARCH, SEQUENCE, SERVER, SPECIFIC_ROUTINE, SUBQUERY, TABLE, TRANSITION, TRIGGER, TYPE, VARIABLE, VIEW, WRAPPER
-
-
Constructor Summary
Constructors Constructor and Description TriggerDef(HsqlNameManager.HsqlName name, int when, int operation, boolean forEachRow, Table table, Table[] transitions, RangeVariable[] rangeVars, Expression condition, java.lang.String conditionSQL, int[] updateColumns)TriggerDef(HsqlNameManager.HsqlName name, int when, int operation, boolean forEach, Table table, Table[] transitions, RangeVariable[] rangeVars, Expression condition, java.lang.String conditionSQL, int[] updateColumns, java.lang.String triggerClassName, boolean noWait, int queueSize)Constructs a new TriggerDef object to represent an HSQLDB trigger declared in an SQL CREATE TRIGGER statement.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcompile(Session session, SchemaObject parentObject)java.lang.StringgetActionOrientationString()java.lang.StringgetActionTimingString()HsqlNameManager.HsqlNamegetCatalogName()longgetChangeTimestamp()java.lang.StringgetClassName()OrderedHashSetgetComponents()java.lang.StringgetConditionSQL()java.lang.StringgetEventTypeString()HsqlNameManager.HsqlNamegetName()java.lang.StringgetNewTransitionRowName()java.lang.StringgetNewTransitionTableName()java.lang.StringgetOldTransitionRowName()java.lang.StringgetOldTransitionTableName()GranteegetOwner()java.lang.StringgetProcedureSQL()OrderedHashSetgetReferences()HsqlNameManager.HsqlNamegetSchemaName()java.lang.StringgetSQL()Retrieves the SQL character sequence required to (re)create the trigger, as a StringBufferjava.lang.StringBuffergetSQLMain()intgetStatementType()TablegetTable()intgetType()int[]getUpdateColumnIndexes()booleanhasNewTable()booleanhasOldTable()booleanisBusy()booleanisForEachRow()booleanisSystem()booleanisValid()voidrun()run method declarationvoidstart()start the thread if this is threadedvoidterminate()signal the thread to stop
-
-
-
Constructor Detail
-
TriggerDef
public TriggerDef(HsqlNameManager.HsqlName name, int when, int operation, boolean forEach, Table table, Table[] transitions, RangeVariable[] rangeVars, Expression condition, java.lang.String conditionSQL, int[] updateColumns, java.lang.String triggerClassName, boolean noWait, int queueSize)
Constructs a new TriggerDef object to represent an HSQLDB trigger declared in an SQL CREATE TRIGGER statement. Changes in 1.7.2 allow the queue size to be specified as 0. A zero queue size causes the Trigger.fire() code to run in the main thread of execution (fully inside the enclosing transaction). Otherwise, the code is run in the Trigger's own thread. (fredt@users)- Parameters:
name- The trigger object's HsqlNamewhen- whether the trigger fires before, after or instead of the triggering eventoperation- the triggering operation; currently insert, update, or deleteforEach- indicates whether the trigger is fired for each row (true) or statement (false)table- the Table object upon which the indicated operation fires the triggertriggerClassName- the fully qualified named of the class implementing the org.hsqldb.Trigger (trigger body) interfacenoWait- do not wait for available space on the pending queue; if the pending queue does not have fewer than nQueueSize queued items, then overwrite the current tail insteadqueueSize- the length to which the pending queue may grow before further additions are either blocked or overwrite the tail entry, as determined by noWait
-
TriggerDef
public TriggerDef(HsqlNameManager.HsqlName name, int when, int operation, boolean forEachRow, Table table, Table[] transitions, RangeVariable[] rangeVars, Expression condition, java.lang.String conditionSQL, int[] updateColumns)
-
-
Method Detail
-
isValid
public boolean isValid()
-
getType
public int getType()
- Specified by:
getTypein interfaceSchemaObject
-
getName
public HsqlNameManager.HsqlName getName()
- Specified by:
getNamein interfaceSchemaObject
-
getCatalogName
public HsqlNameManager.HsqlName getCatalogName()
- Specified by:
getCatalogNamein interfaceSchemaObject
-
getSchemaName
public HsqlNameManager.HsqlName getSchemaName()
- Specified by:
getSchemaNamein interfaceSchemaObject
-
getOwner
public Grantee getOwner()
- Specified by:
getOwnerin interfaceSchemaObject
-
getReferences
public OrderedHashSet getReferences()
- Specified by:
getReferencesin interfaceSchemaObject
-
getComponents
public OrderedHashSet getComponents()
- Specified by:
getComponentsin interfaceSchemaObject
-
compile
public void compile(Session session, SchemaObject parentObject)
- Specified by:
compilein interfaceSchemaObject
-
getSQL
public java.lang.String getSQL()
Retrieves the SQL character sequence required to (re)create the trigger, as a StringBuffer- Specified by:
getSQLin interfaceSchemaObject- Returns:
- the SQL character sequence required to (re)create the trigger
-
getChangeTimestamp
public long getChangeTimestamp()
- Specified by:
getChangeTimestampin interfaceSchemaObject
-
getSQLMain
public java.lang.StringBuffer getSQLMain()
-
getClassName
public java.lang.String getClassName()
-
getActionTimingString
public java.lang.String getActionTimingString()
-
getEventTypeString
public java.lang.String getEventTypeString()
-
isSystem
public boolean isSystem()
-
isForEachRow
public boolean isForEachRow()
-
getConditionSQL
public java.lang.String getConditionSQL()
-
getProcedureSQL
public java.lang.String getProcedureSQL()
-
getUpdateColumnIndexes
public int[] getUpdateColumnIndexes()
-
hasOldTable
public boolean hasOldTable()
-
hasNewTable
public boolean hasNewTable()
-
getOldTransitionRowName
public java.lang.String getOldTransitionRowName()
-
getNewTransitionRowName
public java.lang.String getNewTransitionRowName()
-
getOldTransitionTableName
public java.lang.String getOldTransitionTableName()
-
getNewTransitionTableName
public java.lang.String getNewTransitionTableName()
-
getStatementType
public int getStatementType()
-
run
public void run()
run method declarationthe trigger JSP is run in its own thread here. Its job is simply to wait until it is told by the main thread that it should fire the trigger.
- Specified by:
runin interfacejava.lang.Runnable
-
start
public void start()
start the thread if this is threaded
-
terminate
public void terminate()
signal the thread to stop
-
isBusy
public boolean isBusy()
-
getTable
public Table getTable()
-
getActionOrientationString
public java.lang.String getActionOrientationString()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG