EODatabaseOperation
Inherits from: NSObject
Conforms to: NSObject
(NSObject)
Declared in: EOAccess/EODatabaseOperation.h
Class Description
An EODatabaseOperation object represents an operation-insert, update, or delete-to perform on an enterprise object and all the necessary information required to perform the operation. You don't ordinarily create instances of EODatabaseOperation; rather, the Framework automatically creates an EODatabaseOperation object for each new, updated, or deleted object in an EOEditingContext. An EODatabaseContext object analyzes a set of database operations and maps each operation to one or more adaptor operations. The adaptor operations are then performed by an EOAdaptorChannel object. You generally interact with EODatabaseOperation 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 EODatabaseOperation specifies an enterprise object (called "object") on which the operation is performed, the EOGlobalID for the object, and the object's entity. In addition, the database operation has a snapshot containing the last known database values for the object and a newRow dictionary of new or updated values to save in the database.
Constants
In EODatabaseOperation.h, EOAccess defines
two enumeration types, EOAdaptorOperator
and EODatabaseOperator
,
to identify the primitive database operation represented by an EOAdaptorOperation
object or an EODatabaseOperation object. Their constants are:
EOAdaptorOperation Operators | EODatabaseOperation Operators |
EOAdaptorLockOperator | EODatabaseNothingOperator |
EOAdaptorInsertOperator | EODatabaseInsertOperator |
EOAdaptorUpdateOperator | EODatabaseUpdateOperator |
EOAdaptorDeleteOperator | EODatabaseDeleteOperator |
EOAdaptorStoredProcedureOperator |
Method Types
- Creating a new EODatabaseOperation
- - initWithGlobalID:object:entity:
- Accessing the global ID object
- - globalID
- Accessing the object
- - object
- Accessing the entity
- - entity
- Accessing the operator
- - setDatabaseOperator:
- - databaseOperator
- Accessing the database snapshot
- - setDBSnapshot:
- - dbSnapshot
- Accessing the row
- - setNewRow:
- - newRow
- Accessing the adaptor operations
- - addAdaptorOperation:
- - removeAdaptorOperation:
- - adaptorOperations
- Comparing new row and snapshot values
- - rowDiffs
- - rowDiffsForAttributes:
- Working with to-many snapshots
- - recordToManySnapshot:relationshipName:
- - toManySnapshots
Instance Methods
adaptorOperations
- (NSArray *)adaptorOperations
See Also: - addAdaptorOperation:, - removeAdaptorOperation:
addAdaptorOperation:
- (void)addAdaptorOperation:(EOAdaptorOperation
*)adaptorOperation
See Also: - adaptorOperations, - removeAdaptorOperation:
databaseOperator
- (EODatabaseOperator)databaseOperator
dbSnapshot
- (NSDictionary *)dbSnapshot
See Also: - setDatabaseOperator:
entity
- (EOEntity *)entity
See Also: - initWithGlobalID:object:entity:
globalID
- (EOGlobalID *)globalID
See Also: - initWithGlobalID:object:entity:
initWithGlobalID:object:entity:
- initWithGlobalID:(EOGlobalID
*)globalID object:(id)object
entity:(EOEntity *)entity
newRow
- (NSMutableDictionary *)newRow
The newRow dictionary is initialized with the values in the receiver's snapshot. New or updated values are added to the newRow dictionary (replacing out-of-date values) as the Framework maps changes in the object to an operation.
object
- (id)object
See Also: - initWithGlobalID:object:entity:
primaryKeyDiffs
- (NSDictionary *)primaryKeyDiffs
See Also: - setDatabaseOperator:, - newRow
recordToManySnapshot:relationshipName:
- (void)recordToManySnapshot:(NSArray
*)globalIDs
relationshipName:(NSString *)name
See Also: - toManySnapshots
removeAdaptorOperation:
- (void)removeAdaptorOperation:(EOAdaptorOperation
*)adaptorOperation
See Also: - adaptorOperations, - addAdaptorOperation:
rowDiffs
- (NSDictionary *)rowDiffs
See Also: - primaryKeyDiffs
rowDiffsForAttributes:
- (NSDictionary *)rowDiffsForAttributes:(NSArray
*)attributes
setDatabaseOperator:
- (void)setDatabaseOperator:(EODatabaseOperator)databaseOperator
- EODatabaseNothingOperator
- EODatabaseInsertOperator
- EODatabaseUpdateOperator
- EODatabaseDeleteOperator
setDBSnapshot:
- (void)setDBSnapshot:(NSDictionary
*)dbSnapshot
setNewRow:
- (void)setNewRow:(NSMutableDictionary
*)newRow
See Also: - databaseOperator
toManySnapshots
- (NSDictionary *)toManySnapshots
See Also: - recordToManySnapshot:relationshipName: