|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.javatools.db.AbstractDBObject
oracle.javatools.db.AbstractBuildableObject
oracle.javatools.db.AbstractSystemObject
oracle.javatools.db.AbstractSchemaObject
oracle.javatools.db.PlSql
oracle.javatools.db.Trigger
public class Trigger
Model of a database Trigger. A trigger is essentially a block of pl/sql that will fire on certain defined events on a Table, View, Schema or database itself.
Nested Class Summary | |
---|---|
static class |
Trigger.BaseType Base type for the Trigger (i.e. |
static class |
Trigger.Timing Timing of a trigger - at what point relative to the trigger event the trigger's code will be executed. |
Nested classes/interfaces inherited from class oracle.javatools.db.AbstractDBObject |
---|
AbstractDBObject.ChildSupport |
Field Summary | |
---|---|
static java.lang.String |
ALTER_EVENT |
static java.lang.String |
ANALYZE_EVENT |
static java.lang.String |
ASSOCIATE_STATISTICS_EVENT |
static java.lang.String |
AUDIT_EVENT |
static java.lang.String |
COMMENT_EVENT |
static java.lang.String |
CREATE_EVENT |
static java.lang.String |
DB_ROLE_CHANGE_EVENT |
static java.lang.String |
DDL_EVENT |
static java.lang.String |
DELETE_EVENT |
static java.lang.String |
DISASSOCIATE_STATISTICS_EVENT |
static java.lang.String |
DROP_EVENT |
static java.lang.String |
GRANT_EVENT |
static java.lang.String |
INSERT_EVENT |
static java.lang.String |
LOGOFF_EVENT |
static java.lang.String |
LOGON_EVENT |
static java.lang.String |
NOAUDIT_EVENT |
static java.lang.String |
RENAME_EVENT |
static java.lang.String |
REVOKE_EVENT |
static java.lang.String |
SERVERERROR_EVENT |
static java.lang.String |
SHUTDOWN_EVENT |
static java.lang.String |
STARTUP_EVENT |
static java.lang.String |
SUSPEND_EVENT |
static java.lang.String |
TRUNCATE_EVENT |
static java.lang.String |
TYPE |
static java.lang.String |
UPDATE_EVENT |
Fields inherited from class oracle.javatools.db.PlSql |
---|
BLOCK_TYPE |
Fields inherited from class oracle.javatools.db.AbstractSystemObject |
---|
m_listeners |
Fields inherited from interface oracle.javatools.db.DBObject |
---|
COMMENT |
Constructor Summary | |
---|---|
Trigger() |
|
Trigger(Schema schema, java.lang.String name) |
Method Summary | |
---|---|
java.lang.String |
getBaseSchemaName() Gets the schema name for this trigger. |
Trigger.BaseType |
getBaseType() Gets the base type of the trigger. |
java.lang.String |
getCode() Gets the list of PL/SQL code of the trigger, ie from the BEGIN or DECLARE, to the matching END statement. |
DBObjectID[] |
getColumnIDs() |
java.lang.String[] |
getEvents() Gets the list of events for the trigger. |
static java.util.List |
getEvents(Trigger.BaseType type, Trigger.Timing timing) Returns the valie events for the given BaseType and Timing. |
java.lang.String[] |
getReferenceNames() Deprecated. - see getReferencingOldAs() and getReferencingNewAs() |
java.lang.String |
getReferencingNewAs() Gets the name used in the REFERENCING AS NEW clause of the trigger. |
java.lang.String |
getReferencingOldAs() Gets the name used in the REFERENCING AS OLD clause of the trigger. |
java.lang.String |
getSource() Gets the source to create the trigger. |
DBObjectID |
getTableID() Gets the table name for the trigger. |
Schema |
getTableOwner() Deprecated. - use getBaseSchemaName() |
Trigger.Timing |
getTiming() Gets the timing (before/after) of the trigger. |
java.lang.String |
getType() Returns the type of this object. |
java.lang.String |
getWhenClause() Gets the WHEN clause of the trigger. |
static boolean |
isDatabaseOnlyEvent(java.lang.String event) Returns true if the given event String is only applicable to databases (i.e. |
boolean |
isEnabled() Gets whether this Trigger is enabled. |
boolean |
isStatementLevel() Gets whether or not the trigger is statement level. |
void |
setBaseSchema(Schema schema) Convenience method that calls setBaseSchemaName(String) with the given schema's name. |
void |
setBaseSchemaName(java.lang.String baseSchemaName) Sets the schema name that this trigger has as its base. |
void |
setBaseType(Trigger.BaseType baseType) Sets the base type of the trigger. |
void |
setCode(java.lang.String code) Sets the list of PL/SQL code of the trigger, ie from the BEGIN or DECLARE, to the matching END statement. |
void |
setColumnIDs(DBObjectID[] ids) |
void |
setEnabled(boolean enabled) Sets whether this Trigger is enabled. |
void |
setEvents(java.lang.String[] events) Sets the list of events for the trigger. |
void |
setReferenceNames(java.lang.String[] names) Deprecated. - see setReferencingOldAs(java.lang.String) and setReferencingNewAs(java.lang.String) |
void |
setReferencingNewAs(java.lang.String referencingNewAs) Sets the name used in the REFERENCING AS NEW clause of the trigger. |
void |
setReferencingOldAs(java.lang.String referencingOldAs) Sets the name used in the REFERENCING AS OLD clause of the trigger. |
void |
setSource(java.lang.String source) Sets the source to create the trigger. |
void |
setStatementLevel(boolean statementLevel) Sets whether or not the trigger is statement level. |
void |
setTableID(DBObjectID tableID) Sets the table name for the trigger. |
void |
setTableOwner(Schema owner) Deprecated. - see information on getTableOwner() . |
void |
setTiming(Trigger.Timing timing) Sets the timing (before/after) of the trigger. |
void |
setWhenClause(java.lang.String whenClause) Sets the WHEN clause of the trigger. |
Methods inherited from class oracle.javatools.db.PlSql |
---|
copyToImpl, equalsImpl, getSourceInterrogator, isPlSql |
Methods inherited from class oracle.javatools.db.AbstractSchemaObject |
---|
addObjectListener, getProperty, getSchema, removeObjectListener, setProperty, setSchema |
Methods inherited from class oracle.javatools.db.AbstractSystemObject |
---|
addObjectListener, fireObjectUpdated, getParent, removeObjectListener |
Methods inherited from class oracle.javatools.db.AbstractBuildableObject |
---|
checkInit, checkInit, getOwnedObjectsImpl, getProperties, getReferenceIDsImpl, needsInitialization |
Methods inherited from class oracle.javatools.db.AbstractDBObject |
---|
changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyTo, equals, findOwnedObject, findOwnedObject, findOwnedObject, getChildSupport, getID, getName, getOwnedObjects, getOwnedObjects, getProperty, getReferenceIDs, hashCode, includeOwnedObject, includesType, includesType, removeThisAsParent, replaceReferenceIDs, setID, setName, setProperties, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface oracle.javatools.db.SchemaObject |
---|
addObjectListener, getSchema, removeObjectListener, setSchema |
Methods inherited from interface oracle.javatools.db.SystemObject |
---|
addObjectListener, fireObjectUpdated, removeObjectListener |
Methods inherited from interface oracle.javatools.db.DBObject |
---|
copyTo, copyTo, copyTo, findOwnedObject, findOwnedObject, getID, getName, getOwnedObjects, getOwnedObjects, getParent, getReferenceIDs, replaceReferenceIDs, setID, setName |
Methods inherited from interface oracle.javatools.util.DynamicPropertySet |
---|
getProperties, getProperty, getProperty, setProperties, setProperty |
Field Detail |
---|
public static final java.lang.String TYPE
public static final java.lang.String INSERT_EVENT
public static final java.lang.String DELETE_EVENT
public static final java.lang.String UPDATE_EVENT
public static final java.lang.String ALTER_EVENT
public static final java.lang.String ANALYZE_EVENT
public static final java.lang.String ASSOCIATE_STATISTICS_EVENT
public static final java.lang.String AUDIT_EVENT
public static final java.lang.String COMMENT_EVENT
public static final java.lang.String CREATE_EVENT
public static final java.lang.String DISASSOCIATE_STATISTICS_EVENT
public static final java.lang.String DB_ROLE_CHANGE_EVENT
public static final java.lang.String DROP_EVENT
public static final java.lang.String GRANT_EVENT
public static final java.lang.String NOAUDIT_EVENT
public static final java.lang.String RENAME_EVENT
public static final java.lang.String REVOKE_EVENT
public static final java.lang.String TRUNCATE_EVENT
public static final java.lang.String DDL_EVENT
public static final java.lang.String SERVERERROR_EVENT
public static final java.lang.String LOGON_EVENT
public static final java.lang.String LOGOFF_EVENT
public static final java.lang.String STARTUP_EVENT
public static final java.lang.String SHUTDOWN_EVENT
public static final java.lang.String SUSPEND_EVENT
Constructor Detail |
---|
public Trigger()
public Trigger(Schema schema, java.lang.String name)
Method Detail |
---|
public static boolean isDatabaseOnlyEvent(java.lang.String event)
event
- the event string to querypublic static java.util.List getEvents(Trigger.BaseType type, Trigger.Timing timing)
public java.lang.String getType()
DBObject
public boolean isEnabled()
public void setEnabled(boolean enabled)
public Trigger.Timing getTiming()
setSource(java.lang.String)
for limitations on the use of getSource(), setSource() and the other get/set methods of this class.public void setTiming(Trigger.Timing timing)
setSource(java.lang.String)
for limitations on the use of getSource(), setSource() and the other get/set methods of this class.public boolean isStatementLevel()
setSource(java.lang.String)
for limitations on the use of getSource(), setSource() and the other get/set methods of this class.public void setStatementLevel(boolean statementLevel)
setSource(java.lang.String)
for limitations on the use of getSource(), setSource() and the other get/set methods of this class.public java.lang.String[] getEvents()
setSource(java.lang.String)
for limitations on the use of getSource(), setSource() and the other get/set methods of this class.public void setEvents(java.lang.String[] events)
setSource(java.lang.String)
for limitations on the use of getSource(), setSource() and the other get/set methods of this class.public java.lang.String getBaseSchemaName()
base type
of the trigger is Trigger.BaseType.SCHEMA
.
See setSource(java.lang.String)
for limitations on the use of getSource(), setSource() and the other get/set methods of this class.
public void setBaseSchemaName(java.lang.String baseSchemaName)
Trigger.BaseType.SCHEMA
triggers.
See setSource(java.lang.String)
for limitations on the use of getSource(), setSource() and the other get/set methods of this class.
public void setBaseSchema(Schema schema)
setBaseSchemaName(String)
with the given schema's name.schema
- the schema whose name is to be used as the baseSchemaName property. If null, the baseSchemaName is set to null.setBaseSchemaName(String)
@Deprecated
public Schema getTableOwner()
getBaseSchemaName()
getTableID()
, resolve it and get the schema. If you want the base schema for a Trigger.BaseType.SCHEMA
trigger use getBaseSchemaName().
@Deprecated
public void setTableOwner(Schema owner)
getTableOwner()
.setSource(java.lang.String)
for limitations on the use of getSource(), setSource() and the other get/set methods of this class.public DBObjectID getTableID()
setSource(java.lang.String)
for limitations on the use of getSource(), setSource() and the other get/set methods of this class.public void setTableID(DBObjectID tableID)
setSource(java.lang.String)
for limitations on the use of getSource(), setSource() and the other get/set methods of this class.public Trigger.BaseType getBaseType()
setSource(java.lang.String)
for limitations on the use of getSource(), setSource() and the other get/set methods of this class.public void setBaseType(Trigger.BaseType baseType)
setSource(java.lang.String)
for limitations on the use of getSource(), setSource() and the other get/set methods of this class.type
-public java.lang.String getWhenClause()
setSource(java.lang.String)
for limitations on the use of getSource(), setSource() and the other get/set methods of this class.public void setWhenClause(java.lang.String whenClause)
setSource(java.lang.String)
for limitations on the use of getSource(), setSource() and the other get/set methods of this class.public DBObjectID[] getColumnIDs()
public void setColumnIDs(DBObjectID[] ids)
public java.lang.String getCode()
setSource(java.lang.String)
for limitations on the use of getSource(), setSource() and the other get/set methods of this class.public void setCode(java.lang.String code)
setSource(java.lang.String)
for limitations on the use of getSource(), setSource() and the other get/set methods of this class.public void setReferencingNewAs(java.lang.String referencingNewAs)
setSource(java.lang.String)
for limitations on the use of getSource(), setSource() and the other get/set methods of this class.public java.lang.String getReferencingNewAs()
setSource(java.lang.String)
for limitations on the use of getSource(), setSource() and the other get/set methods of this class.public void setReferencingOldAs(java.lang.String referencingOldAs)
setSource(java.lang.String)
for limitations on the use of getSource(), setSource() and the other get/set methods of this class.public java.lang.String getReferencingOldAs()
setSource(java.lang.String)
for limitations on the use of getSource(), setSource() and the other get/set methods of this class.
@Deprecated
public java.lang.String[] getReferenceNames()
getReferencingOldAs()
and getReferencingNewAs()
@Deprecated
public void setReferenceNames(java.lang.String[] names)
setReferencingOldAs(java.lang.String)
and setReferencingNewAs(java.lang.String)
public java.lang.String getSource()
setSource(java.lang.String)
for limitations on the use of getSource(), setSource() and the other get/set methods of this class.getSource
in interface SourceObject
getSource
in class PlSql
public void setSource(java.lang.String source)
The source is the entire Trigger definition as it would appear in the USER_SOURCE view. This source by definition covers all the other attributes of a Trigger listed in this class, and which have their own get and set methods. However, as the ALTER TRIGGER statement is very limited in its capabilities, a modification to a trigger is usually made by resubmitting the enitire source (typically with CREATE OR REPLACE).
The trigger class itself however, is not responsible for keeping its internal representation of the source and the other declarative properties in step.
If changes are made via the setTiming(oracle.javatools.db.Trigger.Timing)
, setEvents(java.lang.String[])
, setCode(java.lang.String)
methods etc, it will be necessary to use the DDLGenerator
to construct the full source, and then set this using this method.
If changes are made to the source via this method, it will be necessary to use the PlSqlDeclarator
to set the other attributes correctly.
setSource
in interface SourceObject
setSource
in class PlSql
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |