EOObjectStore
- Inherits from:
- (com.apple.client.eocontrol) Object
(com.apple.yellow.eocontrol) NSObject
- Package:
- com.apple.client.eocontrol
- com.apple.yellow.eocontrol
Class Description
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:
- EOCooperatingObjectStore
- EOObjectStoreCoordinator
- EODatabaseContext (EOAccess)
A subclass of EOObjectStore must implement all of its methods. The default implementations simply throw exceptions.
Constants
EOObjectStore defines the following String constants to be used as keys in the notifications it posts:
Additionally, EOObjectStore defines String constants for the names of the notifications it posts. See the section "Notifications" for more information on the notifications.
Method Types
- Initializing objects
- initializeObject
- Getting objects
- objectsWithFetchSpecification
- objectsForSourceGlobalID
- Getting faults
- faultForGlobalID
- arrayFaultWithSourceGlobalID
- refaultObject
- faultForRawRow
- Locking objects
- lockObjectWithGlobalID
- isObjectLockedWithGlobalID
- Saving changes to objects
- saveChangesInEditingContext
- Invalidating and forgetting objects
- invalidateAllObjects
- invalidateObjectsWithGlobalIDs
- editingContextDidForgetObjectWithGlobalID
- Interacting with the server
- invokeRemoteMethod (com.apple.client.eocontrol only)
Instance Methods
arrayFaultWithSourceGlobalID
public abstract NSArray
arrayFaultWithSourceGlobalID
(
EOGlobalID globalID,
String relationshipName,
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 message and that turns the fault into an array containing those objects. See the EOFaultHandler class specification 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
editingContextDidForgetObjectWithGlobalID
public void
editingContextDidForgetObjectWithGlobalID
(
EOEditingContext context,
EOGlobalID gid)
faultForGlobalID
public abstract EOEnterpriseObject
faultForGlobalID
(
EOGlobalID globalID,
EOEditingContext anEditingContext)
If you implement this method to return a fault (an empty enterprise object), you must define an EOFaultHandler subclass that stores globalID, uses it to fetch the object's data, and initializes the object with EOObjectStore's initializeObject. See the EOFaultHandler class specification 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, recordObject ( EOEditingContext)
faultForRawRow
public abstract EOEnterpriseObject
faultForRawRow
(
NSDictionary row,
String entityName,
EOEditingContext anEOEditingContext)
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.
initializeObject
public abstract void
initializeObject
(
EOEnterpriseObject anObject,
EOGlobalID globalID,
EOEditingContext anEditingContext)
See Also: awakeFromInsertion ( EOEnterpriseObject), awakeFromFetch ( EOEnterpriseObject)
invalidateAllObjects
public abstract void
invalidateAllObjects
()
This method should also post an InvalidatedAllObjectsInStoreNotification.
See Also: invalidateObjectsWithGlobalIDs, refaultObject
invalidateObjectsWithGlobalIDs
public abstract void
invalidateObjectsWithGlobalIDs
(NSArray globalIDs)
See Also: invalidateAllObjects, refaultObject
invokeRemoteMethod
public abstract void
invokeRemoteMethod
(
EOEditingContext anEditingContext,
EOGlobalID receiverGID,
String methodName,
Object[] arguments)
(com.apple.client.eocontrol only) Invokes methodName on the enterprise object identified by receiverGID in anEditingContext, using arguments. To pass an enterprise object as an argument, use its global ID. This method has the side effect of saving all the changes from the editing context all the way down to the editing context in the server session.
isObjectLockedWithGlobalID
public abstract boolean
isObjectLockedWithGlobalID
(
EOGlobalID globalID,
EOEditingContext anEditingContext)
lockObjectWithGlobalID
public abstract void
lockObjectWithGlobalID
(
EOGlobalID globalID,
EOEditingContext anEditingContext)
objectsForSourceGlobalID
public abstract NSArray
objectsForSourceGlobalID
(
EOGlobalID globalID,
String relationshipName,
EOEditingContext anEditingContext)
See the EOEditingContext and EODatabaseContext (EOAccess) class specifications for more information on how this method works in concrete subclasses.
objectsWithFetchSpecification
public abstract NSArray
objectsWithFetchSpecification
(
EOFetchSpecification aFetchSpecification,
EOEditingContext anEditingContext)
See the EOEditingContext and EODatabaseContext (EOAccess) class specifications for more information on how this method works in concrete subclasses.
refaultObject
public abstract void
refaultObject
(
EOEnterpriseObject anObject,
EOGlobalID globalID,
EOEditingContext anEditingContext)
saveChangesInEditingContext
public abstract void
saveChangesInEditingContext
(EOEditingContext anEditingContext)
Notifications
InvalidatedAllObjectsInStoreNotification
public static final String InvalidatedAllObjectsInStoreNotification
Notification Object | The EOObjectStore that received the invalidateAllObjects message. |
Userinfo | None |
ObjectsChangedInStoreNotification
public static final String ObjectsChangedInStoreNotification
- Notification Object
- The EOObjectStore that observed the change
- userInfo
- A dictionary containing the following keys and values:
Key | Value |
UpdatedKey | An NSArray of EOGlobalIDs for objects whose properties have changed. A receiving EOEditingContext typically responds by refaulting its corresponding objects. |
InsertedKey | An NSArray of EOGlobalIDs for objects that have been inserted into the EOObjectStore. |
DeletedKey | An NSArray of EOGlobalIDs for objects that have been deleted from the EOObjectStore. |
InvalidatedKey | An NSArray of EOGlobalIDs for objects that have been turned into faults. |