- Inherits from:
- NSObject
- Conforms to:
- NSObject
- (NSObject)
Declared in:
- EOControl/EOObjectStore.h
EOObjectStore is the abstract class that defines the API for an "intelligent" repository of objects, the control layer's object storage abstraction. An object store is responsible for constructing and registering objects, servicing object faults, and saving changes made to objects. For more information on the object storage abstraction, see "Object Storage Abstraction" in the introduction to the EOControl Framework.
EOEditingContext is the principal EOObjectStore subclass and is used for managing objects in memory-in fact, the primary purpose of the EOObjectStore class is to define an API for servicing editing contexts, not to define a completely general API. Other subclasses of EOObjectStore are:
A subclass of EOObjectStore must implement all of its methods. The default implementations simply raise exceptions.
In EOObjectStore.h, EOControl defines the following NSString constants to be used as keys in the notifications it posts:
Additionally, EOObjectStore.h defines NSString constants for the names of the notifications it posts. See the section "Notifications" for more information on the notifications.
- Initializing objects
- - initializeObject:withGlobalID:editingContext:
- Getting objects
- - objectsWithFetchSpecification:editingContext:
- - objectsForSourceGlobalID:relationshipName:editingContext:
- Getting faults
- - faultForGlobalID:editingContext:
- - arrayFaultWithSourceGlobalID:relationshipName:editingContext:
- - refaultObject:withGlobalID:editingContext:
- - faultForRawRow:entityNamed:editingContext:
- Locking objects
- - lockObjectWithGlobalID:editingContext:
- - isObjectLockedWithGlobalID:editingContext:
- Saving changes to objects
- - saveChangesInEditingContext:
- Invalidating and forgetting objects
- - invalidateAllObjects
- - invalidateObjectsWithGlobalIDs:
- - editingContext:didForgetObjectWithGlobalID:
- (NSArray *)arrayFaultWithSourceGlobalID:(EOGlobalID
*)globalID
relationshipName:(NSString *)relationshipName
editingContext:(EOEditingContext
*)anEditingContext
If you implement this method to return a fault, you must define an EOFaultHandler subclass that stores globalID and relationshipName, using them to fetch the objects in a later objectsForSourceGlobalID:relationshipName:editingContext: message and that turns the fault into an array containing those objects. See the EOFaultHandler and EOFault class specifications for more information on faults.
See the EOEditingContext and EODatabaseContext (EOAccess) class specifications for more information on how this method works in concrete subclasses.
See Also: - faultForGlobalID:editingContext:
- (void)editingContext:(EOEditingContext
*)context
didForgetObjectWithGlobalID:(EOGlobalID
*)gid
- (id)faultForGlobalID:(EOGlobalID
*)globalID
editingContext:(EOEditingContext
*)anEditingContext
If you implement this method to return a fault (an EOFault object), you must define an EOFaultHandler subclass that stores globalID, uses it to fetch the object and turn the EOFault into that object, and initializes the object with EOObjectStore's initializeObject:withGlobalID:editingContext:. See the EOFaultHandlerand EOFault class specifications for more information on faults.
See the EOEditingContext and EODatabaseContext (EOAccess) class specifications for more information on how this method works in concrete subclasses.
See Also: - arrayFaultWithSourceGlobalID:relationshipName:editingContext:, - recordObject:globalID: ( EOEditingContext)
- (id)faultForRawRow:(id)row
entityNamed:(NSString *)entityName
editingContext:(EOEditingContext
*)anEditingContext
Returns a fault for the enterprise object corresponding to row, which is a dictionary of values containing at least the primary key of the corresponding enterprise object. This is especially useful if you have fetched raw rows and now want a unique enterprise object.
- (void)initializeObject:(id)anObject
withGlobalID:(EOGlobalID *)globalID
editingContext:(EOEditingContext
*)anEditingContext
See Also: awakeFromInsertionInEditingContext: ( EOEnterpriseObject), awakeFromFetchInEditingContext: ( EOEnterpriseObject)
- (void)invalidateAllObjects
This method should also post an EOInvalidatedAllObjectsInStoreNotification.
See Also: - invalidateObjectsWithGlobalIDs:, - refaultObject:withGlobalID:editingContext:
- (void)invalidateObjectsWithGlobalIDs:(NSArray
*)globalIDs
See Also: - invalidateAllObjects, - refaultObject:withGlobalID:editingContext:
- (BOOL)isObjectLockedWithGlobalID:(EOGlobalID
*)globalID
editingContext:(EOEditingContext
*)anEditingContext
- (void)lockObjectWithGlobalID:(EOGlobalID
*)globalID
editingContext:(EOEditingContext
*)anEditingContext
- (NSArray *)objectsForSourceGlobalID:(EOGlobalID
*)globalID
relationshipName:(NSString *)relationshipName
editingContext:(EOEditingContext
*)anEditingContext
See the EOEditingContext and EODatabaseContext (EOAccess) class specifications for more information on how this method works in concrete subclasses.
- (NSArray *)objectsWithFetchSpecification:(EOFetchSpecification
*)aFetchSpecification
editingContext:(EOEditingContext
*)anEditingContext
See the EOEditingContext and EODatabaseContext (EOAccess) class specifications for more information on how this method works in concrete subclasses.
- (void)refaultObject:(id)anObject
withGlobalID:(EOGlobalID *)globalID
editingContext:(EOEditingContext
*)anEditingContext
- (void)saveChangesInEditingContext:(EOEditingContext
*)anEditingContext
EOCONTROL_EXTERN NSString *EOInvalidatedAllObjectsInStoreNotification
Notification Object | The EOObjectStore that received the invalidateAllObjects message. |
Userinfo | None |
EOCONTROL_EXTERN NSString *EOObjectsChangedInStoreNotification
Key | Value |
EOUpdatedKey | An NSArray of EOGlobalIDs for objects whose properties have changed. A receiving EOEditingContext typically responds by refaulting its corresponding objects. |
EOInsertedKey | An NSArray of EOGlobalIDs for objects that have been inserted into the EOObjectStore. |
EODeletedKey | An NSArray of EOGlobalIDs for objects that have been deleted from the EOObjectStore. |
EOInvalidatedKey | An NSArray of EOGlobalIDs for objects that have been turned into faults. |