PATH |
Inherits from: Object
Package: com.webobjects.eoaccess
An EOAdaptorOperation object represents a primitive operation in a database server-lock, insert, update, or delete a row; or execute a stored procedure-and all the necessary information required by the operation. An EOAdaptorOperation is processed by an EOAdaptorChannel object in the method performAdaptorOperation. You don't ordinarily create instances of EOAdaptorOperation; rather, the Framework automatically creates an EOAdaptorOperation object and sends it to an adaptor channel when your application needs the database server to perform an operation. You generally interact with EOAdaptorOperation objects only if you need to specify the order in which a set of operations are carried out (see the description for the EODatabaseContext delegate method databaseContext:willOrderAdaptorOperationsFromDatabaseOperations:).
An EOAdaptorOperation has an entity and an operator (the type of operation the object represents). An adaptor operation's operator (AdaptorLockOperator
, AdaptorInsertOperator
, AdaptorUpdateOperator
, AdaptorDeleteOperator
, or AdaptorStoredProcedureOperator
) determines additional, operator-dependent information used by the EOAdaptorOperation object. For example, only a stored procedure operation has an EOStoredProcedure object. The operator-dependent information is accessible using the methods described below.
Constructors EOAdaptorOperation Accessing the entity entity Accessing the operator setAdaptorOperator adaptorOperator Accessing the qualifier setQualifier qualifier Accessing locking attributes setAttributes attributes Accessing operation values setChangedValues changedValues Accessing a stored procedure setStoredProcedure storedProcedure Handling errors during the operation setException exception Comparing operations compareAdaptorOperation
public EOAdaptorOperation(EOEntity entity)
See Also: entity
public int adaptorOperator()
AdaptorInsertOperator
uses changedValues, but not attributes, qualifier, or storedProcedure.
public NSArray attributes()
AdaptorLockOperator
.
public NSDictionary changedValues()
public int compareAdaptorOperation(EOAdaptorOperation operation)
AdaptorLockOperator
AdaptorInsertOperator
AdaptorUpdateOperator
AdaptorDeleteOperator
AdaptorStoredProcedureOperator
AdaptorLockOperator
precedes AdaptorInsertOperator
, AdaptorInsertOperator
precedes AdaptorUpdateOperator
, and so on.
An EODatabaseContext uses compareAdaptorOperation to order adaptor operations before invoking EOAdaptorChannel's performAdaptorOperations method.
public EOEntity entity()
public Throwable exception()
null
if no exception was thrown or if the receiver hasn't been processed yet.
public com.webobjects.eocontrol.EOQualifier qualifier()
AdaptorInsertOperator
and AdaptorStoredProcedureOperator
.
public void setAdaptorOperator(int adaptorOperator)
AdaptorLockOperator
AdaptorInsertOperator
AdaptorUpdateOperator
AdaptorDeleteOperator
AdaptorStoredProcedureOperator
For more information, see the discussion on adaptor operators in the class description above.
public void setAttributes(NSArray attributes)
null
or empty. Generally, an adaptor operation's qualifier contains all the comparisons needed to verify that a row hasn't changed since the application last fetched, inserted, or updated it. In this case (if there aren't any attributes that can't be compared in a qualifier), attributes should contain primary key attributes. This method is only valid for adaptor operations with the AdaptorLockOperator
.
public void setChangedValues(NSDictionary changedValues)
Operator | Contents of changedValues Dictionary |
AdaptorLockOperator |
Snapshot values used to verify that the database row hasn't changed since this application last fetched it |
AdaptorInsertOperator |
The values to insert |
AdaptorUpdateOperator |
The new values for the columns to update |
AdaptorDeleteOperator |
Snapshot values (changedValues is only valid for AdaptorDeleteOperator if the receiver's entity uses a stored procedure to perform delete operations.) |
AdaptorStoredProcedureOperator |
Snapshot values |
public void setException(Throwable exception)
public void setQualifier(com.webobjects.eocontrol.EOQualifier qualifier)
public void setStoredProcedure(EOStoredProcedure storedProcedure)
public EOStoredProcedure storedProcedure()
AdaptorStoredProcedureOperator
.
public String toString()
© 2001 Apple Computer, Inc. (Last Published April 13, 2001)