| java.lang.Object org.apache.derby.iapi.sql.dictionary.TupleDescriptor org.apache.derby.iapi.sql.dictionary.TriggerDescriptor
TriggerDescriptor | public class TriggerDescriptor extends TupleDescriptor implements UniqueSQLObjectDescriptor,Provider,Dependent,Formatable(Code) | | A trigger.
We are dependent on TableDescriptors, SPSDescriptors (for our
WHEN clause and our action). Note that we don't strictly
need to be dependent on out SPSes because we could just disallow
anyone from dropping an sps of type 'T', but to keep dependencies
uniform, we'll do be dependent.
We are a provider for DML (PreparedStatements or SPSes)
The public methods for this class are:
- getUUID
- getName
- getSchemaDescriptor
- public boolean listensForEvent(int event);
- public int getTriggerEventMask();
- public Timestamp getCreationTimestamp();
- public boolean isBeforeTrigger();
- public boolean isRowTrigger();
- public UUID getActionId();
- public SPSDescriptor getActionSPS();
- public UUID getWhenClauseId();
- public SPSDescriptor getWhenClauseSPS()
- public TableDescriptor getTableDescriptor()
- public ReferencedColumns getReferencedColumnsDescriptor()
- public int[] getReferencedCols();
- public boolean isEnabled();
- public void setEnabled();
- public void setDisabled();
- public boolean needsToFire(int stmtType, int[] modifiedCols)
- public String getTriggerDefinition();
- public boolean getReferencingOld();
- public boolean getReferencingNew();
- public String getOldReferencingName();
- public String getNewReferencingName();
author: Jamie |
Constructor Summary | |
public | TriggerDescriptor() | public | TriggerDescriptor(DataDictionary dataDictionary, SchemaDescriptor sd, UUID id, String name, int eventMask, boolean isBefore, boolean isRow, boolean isEnabled, TableDescriptor td, UUID whenSPSId, UUID actionSPSId, Timestamp creationTimestamp, int[] referencedCols, String triggerDefinition, boolean referencingOld, boolean referencingNew, String oldReferencingName, String newReferencingName) Constructor. |
SYSTRIGGERS_STATE_FIELD | final public static int SYSTRIGGERS_STATE_FIELD(Code) | | |
TRIGGER_EVENT_DELETE | final public static int TRIGGER_EVENT_DELETE(Code) | | |
TRIGGER_EVENT_INSERT | final public static int TRIGGER_EVENT_INSERT(Code) | | |
TRIGGER_EVENT_UPDATE | final public static int TRIGGER_EVENT_UPDATE(Code) | | |
TriggerDescriptor | public TriggerDescriptor()(Code) | | Niladic constructor, for formatable
|
TriggerDescriptor | public TriggerDescriptor(DataDictionary dataDictionary, SchemaDescriptor sd, UUID id, String name, int eventMask, boolean isBefore, boolean isRow, boolean isEnabled, TableDescriptor td, UUID whenSPSId, UUID actionSPSId, Timestamp creationTimestamp, int[] referencedCols, String triggerDefinition, boolean referencingOld, boolean referencingNew, String oldReferencingName, String newReferencingName)(Code) | | Constructor. Used when creating a trigger from SYS.SYSTRIGGERS
Parameters: dataDictionary - the data dictionary Parameters: sd - the schema descriptor for this trigger Parameters: id - the trigger id Parameters: name - the trigger name Parameters: eventMask - TriggerDescriptor.TRIGGER_EVENT_XXXX Parameters: isBefore - is this a before (as opposed to after) trigger Parameters: isRow - is this a row trigger or statement trigger Parameters: isEnabled - is this trigger enabled or disabled Parameters: td - the table upon which this trigger is defined Parameters: whenSPSId - the sps id for the when clause (may be null) Parameters: actionSPSId - the spsid for the trigger action (may be null) Parameters: creationTimestamp - when was this trigger created? Parameters: referencedCols - what columns does this trigger reference (may be null) Parameters: triggerDefinition - The original user text of the trigger action Parameters: referencingOld - whether or not OLD appears in REFERENCING clause Parameters: referencingNew - whether or not NEW appears in REFERENCING clause Parameters: oldReferencingName - old referencing table name, if any, that appears in REFERCING clause Parameters: newReferencingName - new referencing table name, if any, that appears in REFERCING clause |
getActionId | public UUID getActionId()(Code) | | Get the trigger action sps UUID
the uuid of the sps action |
getClassType | public String getClassType()(Code) | | Get the provider's type.
char The provider's type. |
getCreationTimestamp | public Timestamp getCreationTimestamp()(Code) | | Get the time that this trigger was created.
the time the trigger was created |
getName | public String getName()(Code) | | Get the trigger name
the name |
getNewReferencingName | public String getNewReferencingName()(Code) | | Get the new Referencing name, if any,
from the REFERENCING clause.
The new Referencing name, if any,from the REFERENCING clause. |
getObjectID | public UUID getObjectID()(Code) | | Get the provider's UUID
The provider's UUID |
getObjectName | public String getObjectName()(Code) | | Return the name of this Provider. (Useful for errors.)
String The name of this provider. |
getOldReferencingName | public String getOldReferencingName()(Code) | | Get the old Referencing name, if any,
from the REFERENCING clause.
The old Referencing name, if any,from the REFERENCING clause. |
getReferencedCols | public int[] getReferencedCols()(Code) | | Get the referenced column array for this trigger, used in "alter table
drop column", we get the handle and change it
the referenced column array |
getReferencingNew | public boolean getReferencingNew()(Code) | | Get whether or not NEW was replaced
in the REFERENCING clause.
Whether or not NEW was replacedin the REFERENCING clause. |
getReferencingOld | public boolean getReferencingOld()(Code) | | Get whether or not OLD was replaced
in the REFERENCING clause.
Whether or not OLD was replacedin the REFERENCING clause. |
getTriggerDefinition | public String getTriggerDefinition()(Code) | | Get the original trigger definition.
The trigger definition. |
getTriggerEventMask | public int getTriggerEventMask()(Code) | | Get the trigger event mask. Currently, a trigger
may only listen for a single event, though it may
OR multiple events in the future.
the trigger event mask |
getTypeFormatId | public int getTypeFormatId()(Code) | | Get the formatID which corresponds to this class.
the formatID of this class |
getUUID | public UUID getUUID()(Code) | | Get the trigger UUID
the id |
getWhenClauseId | public UUID getWhenClauseId()(Code) | | Get the trigger when clause sps UUID
the uuid of the sps action |
isBeforeTrigger | public boolean isBeforeTrigger()(Code) | | Is this a before trigger
true if it is a before trigger |
isEnabled | public boolean isEnabled()(Code) | | Is this trigger enabled
true if it is enabled |
isRowTrigger | public boolean isRowTrigger()(Code) | | Is this a row trigger
true if it is a before trigger |
isValid | public synchronized boolean isValid()(Code) | | Check that all of the dependent's dependencies are valid.
true if the dependent is currently valid |
listensForEvent | public boolean listensForEvent(int event)(Code) | | Indicate whether this trigger listens for this
type of event.
Parameters: event - TRIGGER_EVENT_XXXX true if it listens to the specified event. |
makeInvalid | public void makeInvalid(int action, LanguageConnectionContext lcc) throws StandardException(Code) | | Mark the dependent as invalid (due to at least one of
its dependencies being invalid). Always an error
for a trigger -- should never have gotten here.
Parameters: lcc - the language connection context Parameters: action - The action causing the invalidation exception: StandardException - thrown if called in sanity mode |
makeValid | public void makeValid(LanguageConnectionContext lcc)(Code) | | Attempt to revalidate the dependent. Meaningless
for a trigger.
Parameters: lcc - the language connection context |
needsToFire | public boolean needsToFire(int stmtType, int[] modifiedCols) throws StandardException(Code) | | Does this trigger need to fire on this type of
DML?
Parameters: stmtType - the type of DML (StatementType.INSERT|StatementType.UPDATE|StatementType.DELETE) Parameters: modifiedCols - the columns modified, or null for all true/false exception: StandardException - on error |
prepareToInvalidate | public void prepareToInvalidate(Provider p, int action, LanguageConnectionContext lcc) throws StandardException(Code) | | Prepare to mark the dependent as invalid (due to at least one of
its dependencies being invalid).
Parameters: action - The action causing the invalidation Parameters: p - the provider Parameters: lcc - the language connection context exception: StandardException - thrown if unable to make it invalid |
setDisabled | public void setDisabled()(Code) | | Mark this trigger as disabled
|
setEnabled | public void setEnabled()(Code) | | Mark this trigger as enabled
|
writeExternal | public void writeExternal(ObjectOutput out) throws IOException(Code) | | Write this object to a stream of stored objects.
Parameters: out - write bytes here. exception: IOException - thrown on error |
|
|