|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.derby.iapi.sql.dictionary.TupleDescriptor
org.apache.derby.iapi.sql.dictionary.TriggerDescriptor
public class TriggerDescriptor
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:
| Field Summary | |
|---|---|
private SPSDescriptor |
actionSPS
|
private UUID |
actionSPSId
|
private java.sql.Timestamp |
creationTimestamp
|
private int |
eventMask
|
private UUID |
id
|
private boolean |
isBefore
|
private boolean |
isEnabled
|
private boolean |
isRow
|
private java.lang.String |
name
|
private java.lang.String |
newReferencingName
|
private java.lang.String |
oldReferencingName
|
private int[] |
referencedCols
|
private int[] |
referencedColsInTriggerAction
|
private boolean |
referencingNew
|
private boolean |
referencingOld
|
private SchemaDescriptor |
sd
|
static int |
SYSTRIGGERS_STATE_FIELD
|
private TableDescriptor |
td
|
static int |
TRIGGER_EVENT_DELETE
|
static int |
TRIGGER_EVENT_INSERT
|
static int |
TRIGGER_EVENT_UPDATE
|
private java.lang.String |
triggerDefinition
|
private UUID |
triggerSchemaId
|
private UUID |
triggerTableId
|
private SPSDescriptor |
whenSPS
|
private UUID |
whenSPSId
|
| Fields inherited from interface org.apache.derby.catalog.Dependable |
|---|
ACTIVATION, ALIAS, COLUMNS_IN_TABLE, COLUMNS_PERMISSION, CONGLOMERATE, CONSTRAINT, DEFAULT, FILE, HEAP, INDEX, PERM, PREPARED_STATEMENT, ROLE_GRANT, ROUTINE_PERMISSION, SCHEMA, SEQUENCE, STORED_PREPARED_STATEMENT, TABLE, TABLE_PERMISSION, TRIGGER, VIEW |
| Constructor Summary | |
|---|---|
TriggerDescriptor()
Niladic constructor, for formatable |
|
TriggerDescriptor(DataDictionary dataDictionary,
SchemaDescriptor sd,
UUID id,
java.lang.String name,
int eventMask,
boolean isBefore,
boolean isRow,
boolean isEnabled,
TableDescriptor td,
UUID whenSPSId,
UUID actionSPSId,
java.sql.Timestamp creationTimestamp,
int[] referencedCols,
int[] referencedColsInTriggerAction,
java.lang.String triggerDefinition,
boolean referencingOld,
boolean referencingNew,
java.lang.String oldReferencingName,
java.lang.String newReferencingName)
Constructor. |
|
| Method Summary | |
|---|---|
void |
drop(LanguageConnectionContext lcc)
|
UUID |
getActionId()
Get the trigger action sps UUID |
SPSDescriptor |
getActionSPS(LanguageConnectionContext lcc)
Get the trigger action sps from SYSSTATEMENTS. |
java.lang.String |
getClassType()
Get the provider's type. |
java.sql.Timestamp |
getCreationTimestamp()
Get the time that this trigger was created. |
protected DataDictionary |
getDataDictionary()
|
DependableFinder |
getDependableFinder()
Get an object which can be written to disk and which, when read from disk, will find or reconstruct this in-memory Dependable. |
java.lang.String |
getDescriptorName()
|
java.lang.String |
getDescriptorType()
Each descriptor must identify itself with its type; i.e index, check constraint whatever. |
java.lang.String |
getName()
Get the trigger name |
java.lang.String |
getNewReferencingName()
Get the new Referencing name, if any, from the REFERENCING clause. |
UUID |
getObjectID()
Get the provider's UUID |
java.lang.String |
getObjectName()
Return the name of this Provider. |
java.lang.String |
getOldReferencingName()
Get the old Referencing name, if any, from the REFERENCING clause. |
int[] |
getReferencedCols()
Get the referenced column array for this trigger, used in "alter table drop column", we get the handle and change it |
int[] |
getReferencedColsInTriggerAction()
Get the referenced column array for the trigger action columns. |
boolean |
getReferencingNew()
Get whether or not NEW was replaced in the REFERENCING clause. |
boolean |
getReferencingOld()
Get whether or not OLD was replaced in the REFERENCING clause. |
SchemaDescriptor |
getSchemaDescriptor()
Get the triggers schema descriptor |
TableDescriptor |
getTableDescriptor()
Get the trigger table descriptor |
UUID |
getTableId()
|
java.lang.String |
getTriggerDefinition()
Get the original trigger definition. |
int |
getTriggerEventMask()
Get the trigger event mask. |
int |
getTypeFormatId()
Get the formatID which corresponds to this class. |
UUID |
getUUID()
Get the trigger UUID |
UUID |
getWhenClauseId()
Get the trigger when clause sps UUID |
SPSDescriptor |
getWhenClauseSPS()
Get the trigger when clause sps |
boolean |
isBeforeTrigger()
Is this a before trigger |
boolean |
isEnabled()
Is this trigger enabled |
boolean |
isRowTrigger()
Is this a row trigger |
boolean |
isValid()
Check that all of the dependent's dependencies are valid. |
boolean |
listensForEvent(int event)
Indicate whether this trigger listens for this type of event. |
void |
makeInvalid(int action,
LanguageConnectionContext lcc)
Mark the dependent as invalid (due to at least one of its dependencies being invalid). |
boolean |
needsToFire(int stmtType,
int[] modifiedCols)
Does this trigger need to fire on this type of DML? |
void |
prepareToInvalidate(Provider p,
int action,
LanguageConnectionContext lcc)
Prepare to mark the dependent as invalid (due to at least one of its dependencies being invalid). |
void |
readExternal(java.io.ObjectInput in)
Read this object from a stream of stored objects. |
void |
setDisabled()
Mark this trigger as disabled |
void |
setEnabled()
Mark this trigger as enabled |
java.lang.String |
toString()
|
void |
writeExternal(java.io.ObjectOutput out)
Write this object to a stream of stored objects. |
| Methods inherited from class org.apache.derby.iapi.sql.dictionary.TupleDescriptor |
|---|
getColumnDependableFinder, getDependableFinder, isPersistent, setDataDictionary |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.derby.catalog.Dependable |
|---|
isPersistent |
| Field Detail |
|---|
public static final int SYSTRIGGERS_STATE_FIELD
public static final int TRIGGER_EVENT_UPDATE
public static final int TRIGGER_EVENT_DELETE
public static final int TRIGGER_EVENT_INSERT
private UUID id
private java.lang.String name
private java.lang.String oldReferencingName
private java.lang.String newReferencingName
private java.lang.String triggerDefinition
private SchemaDescriptor sd
private int eventMask
private boolean isBefore
private boolean isRow
private boolean referencingOld
private boolean referencingNew
private TableDescriptor td
private UUID actionSPSId
private SPSDescriptor actionSPS
private UUID whenSPSId
private SPSDescriptor whenSPS
private boolean isEnabled
private int[] referencedCols
private int[] referencedColsInTriggerAction
private java.sql.Timestamp creationTimestamp
private UUID triggerSchemaId
private UUID triggerTableId
| Constructor Detail |
|---|
public TriggerDescriptor()
public TriggerDescriptor(DataDictionary dataDictionary,
SchemaDescriptor sd,
UUID id,
java.lang.String name,
int eventMask,
boolean isBefore,
boolean isRow,
boolean isEnabled,
TableDescriptor td,
UUID whenSPSId,
UUID actionSPSId,
java.sql.Timestamp creationTimestamp,
int[] referencedCols,
int[] referencedColsInTriggerAction,
java.lang.String triggerDefinition,
boolean referencingOld,
boolean referencingNew,
java.lang.String oldReferencingName,
java.lang.String newReferencingName)
dataDictionary - the data dictionarysd - the schema descriptor for this triggerid - the trigger idname - the trigger nameeventMask - TriggerDescriptor.TRIGGER_EVENT_XXXXisBefore - is this a before (as opposed to after) triggerisRow - is this a row trigger or statement triggerisEnabled - is this trigger enabled or disabledtd - the table upon which this trigger is definedwhenSPSId - the sps id for the when clause (may be null)actionSPSId - the spsid for the trigger action (may be null)creationTimestamp - when was this trigger created?referencedCols - what columns does this trigger reference (may be null)referencedColsInTriggerAction - what columns does the trigger
action reference through old/new transition variables
(may be null)triggerDefinition - The original user text of the trigger actionreferencingOld - whether or not OLD appears in REFERENCING clausereferencingNew - whether or not NEW appears in REFERENCING clauseoldReferencingName - old referencing table name, if any, that appears in REFERCING clausenewReferencingName - new referencing table name, if any, that appears in REFERCING clause| Method Detail |
|---|
public UUID getUUID()
getUUID in interface UniqueTupleDescriptorpublic java.lang.String getName()
getName in interface UniqueSQLObjectDescriptorpublic UUID getTableId()
public SchemaDescriptor getSchemaDescriptor()
throws StandardException
getSchemaDescriptor in interface UniqueSQLObjectDescriptorStandardException - on errorpublic boolean listensForEvent(int event)
event - TRIGGER_EVENT_XXXX
public int getTriggerEventMask()
public java.sql.Timestamp getCreationTimestamp()
public boolean isBeforeTrigger()
public boolean isRowTrigger()
public UUID getActionId()
public SPSDescriptor getActionSPS(LanguageConnectionContext lcc)
throws StandardException
lcc - The LanguageConnectionContext to use.
StandardException - on errorpublic UUID getWhenClauseId()
public SPSDescriptor getWhenClauseSPS()
throws StandardException
StandardException - on error
public TableDescriptor getTableDescriptor()
throws StandardException
StandardException - on errorpublic int[] getReferencedCols()
public int[] getReferencedColsInTriggerAction()
public boolean isEnabled()
public void setEnabled()
public void setDisabled()
public boolean needsToFire(int stmtType,
int[] modifiedCols)
throws StandardException
stmtType - the type of DML
(StatementType.INSERT|StatementType.UPDATE|StatementType.DELETE)modifiedCols - the columns modified, or null for all
StandardException - on errorpublic java.lang.String getTriggerDefinition()
public boolean getReferencingOld()
public boolean getReferencingNew()
public java.lang.String getOldReferencingName()
public java.lang.String getNewReferencingName()
public java.lang.String toString()
toString in class java.lang.Objectpublic DependableFinder getDependableFinder()
Dependable
getDependableFinder in interface DependableDependable.getDependableFinder()public java.lang.String getObjectName()
getObjectName in interface Dependablepublic UUID getObjectID()
getObjectID in interface Dependablepublic java.lang.String getClassType()
getClassType in interface Dependablepublic boolean isValid()
isValid in interface Dependent
public void prepareToInvalidate(Provider p,
int action,
LanguageConnectionContext lcc)
throws StandardException
prepareToInvalidate in interface Dependentaction - The action causing the invalidationp - the providerlcc - the language connection context
StandardException - thrown if unable to make it invalid
public void makeInvalid(int action,
LanguageConnectionContext lcc)
throws StandardException
makeInvalid in interface Dependentlcc - the language connection contextaction - The action causing the invalidation
StandardException - thrown if called in sanity mode
public void drop(LanguageConnectionContext lcc)
throws StandardException
StandardException
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablein - read this.
java.io.IOException - thrown on error
java.lang.ClassNotFoundException - thrown on errorprotected DataDictionary getDataDictionary()
getDataDictionary in class TupleDescriptor
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizableout - write bytes here.
java.io.IOException - thrown on errorpublic int getTypeFormatId()
getTypeFormatId in interface TypedFormatpublic java.lang.String getDescriptorType()
TupleDescriptor
getDescriptorType in class TupleDescriptorTupleDescriptor.getDescriptorType()public java.lang.String getDescriptorName()
getDescriptorName in class TupleDescriptorTupleDescriptor.getDescriptorName()
|
Built on Wed 2013-06-12 15:21:56+0000, from revision ??? | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||