detectConflictsForObject(NSManagedObject object)
marks an object for conflict detection, which means that the save fails if the object has been altered in the persistent store by another application.
executeFetchRequest_error(NSFetchRequest request,
PointerByReference error)
method to fetch objects from the persistent stores into the context (fetch request defines the entity and predicate as well as a sort order for the objects); context will match the results from persistent stores with current changes in the context (so inserted objects are returned even if they are not persisted yet); to fetch a single object with an ID if it is not guaranteed to exist and thus -objectWithObjectID: cannot be used, one would create a predicate like [NSComparisonPredicate predicateWithLeftExpression:[NSExpression expressionForKeyPath:@"objectID"] rightExpression:[NSExpression expressionForConstantValue:
objectRegisteredForID(NSManagedObjectID objectID)
returns the object for the specified ID if it is registered in the context already or nil
Original signature : -(NSManagedObject*)objectRegisteredForID:(NSManagedObjectID*)
objectWithID(NSManagedObjectID objectID)
returns the object for the specified ID (the object does not already need to be registered in the context, it might be fetched or returned as a fault) - the object is assumed to exist as described by the ID
Original signature : -(NSManagedObject*)objectWithID:(NSManagedObjectID*)
processPendingChanges()
usually contexts process changes to the object graph coalesced at the end of the event - this method triggers it explicitly
Original signature : -(void)processPendingChanges
abstract boolean
propagatesDeletesAtEndOfEvent()
whether or not the context propagates deletes to related objects at the end of the event, or only at save time
Original signature : -(BOOL)propagatesDeletesAtEndOfEvent
refreshObject_mergeChanges(NSManagedObject object,
boolean flag)
if flag is YES, merges an object with the state of the object available in the persistent store coordinator; if flag is NO, simply refaults an object without merging (which also causes other related managed objects to be released, so you can use this method to trim the portion of your object graph you want to hold in memory)
Original signature : -(void)refreshObject:(NSManagedObject*) mergeChanges:(BOOL)
retainsRegisteredObjects()
whether or not the context holds a retain on all registered objects, or only upon objects necessary for a pending save (inserted, updated, deleted, or locked)
Original signature : -(BOOL)retainsRegisteredObjects
setMergePolicy(org.rococoa.ID mergePolicy)
Original signature : -(void)setMergePolicy:(id)
acceptable merge policies are listed above as id constants
abstract void
setPersistentStoreCoordinator(NSPersistentStoreCoordinator coordinator)
coordinator which provides model and handles persistency (multiple contexts can share a coordinator)
Original signature : -(void)setPersistentStoreCoordinator:(NSPersistentStoreCoordinator*)
abstract void
setPropagatesDeletesAtEndOfEvent(boolean flag)
Original signature : -(void)setPropagatesDeletesAtEndOfEvent:(BOOL)
The default is YES.
abstract void
setRetainsRegisteredObjects(boolean flag)
Original signature : -(void)setRetainsRegisteredObjects:(BOOL)
The default is NO.
abstract void
setStalenessInterval(double expiration)
Original signature : -(void)setStalenessInterval:(NSTimeInterval)
a negative value is considered infinite.
coordinator which provides model and handles persistency (multiple contexts can share a coordinator)
Original signature : -(void)setPersistentStoreCoordinator:(NSPersistentStoreCoordinator*)
returns the object for the specified ID if it is registered in the context already or nil
Original signature : -(NSManagedObject*)objectRegisteredForID:(NSManagedObjectID*)
returns the object for the specified ID (the object does not already need to be registered in the context, it might be fetched or returned as a fault) - the object is assumed to exist as described by the ID
Original signature : -(NSManagedObject*)objectWithID:(NSManagedObjectID*)
method to fetch objects from the persistent stores into the context (fetch request defines the entity and predicate as well as a sort order for the objects); context will match the results from persistent stores with current changes in the context (so inserted objects are returned even if they are not persisted yet); to fetch a single object with an ID if it is not guaranteed to exist and thus -objectWithObjectID: cannot be used, one would create a predicate like [NSComparisonPredicate predicateWithLeftExpression:[NSExpression expressionForKeyPath:@"objectID"] rightExpression:[NSExpression expressionForConstantValue:
returns the number of objects a fetch request would have returned if it had been passed to -executeFetchRequest:error:. If an error occurred during the processing of the request, this method will return NSNotFound.
Original signature : -(NSUInteger)countForFetchRequest:(NSFetchRequest*) error:(NSError**)
public abstract void refreshObject_mergeChanges(NSManagedObject object,
boolean flag)
if flag is YES, merges an object with the state of the object available in the persistent store coordinator; if flag is NO, simply refaults an object without merging (which also causes other related managed objects to be released, so you can use this method to trim the portion of your object graph you want to hold in memory)
Original signature : -(void)refreshObject:(NSManagedObject*) mergeChanges:(BOOL)
detectConflictsForObject
public abstract void detectConflictsForObject(NSManagedObject object)
marks an object for conflict detection, which means that the save fails if the object has been altered in the persistent store by another application. This allows optimistic locking for unchanged objects. Conflict detection is always performed on changed or deleted objects.
Original signature : -(void)detectConflictsForObject:(NSManagedObject*)
usually contexts process changes to the object graph coalesced at the end of the event - this method triggers it explicitly
Original signature : -(void)processPendingChanges
assignObject_toPersistentStore
public abstract void assignObject_toPersistentStore(org.rococoa.ID object,
NSPersistentStore store)
specifies the store a newly inserted object will be saved in. Unnecessary unless there are multiple writable persistent stores added to the NSPersistentStoreCoordinator which support this object's entity.
Original signature : -(void)assignObject:(id) toPersistentStore:(NSPersistentStore*)
public abstract boolean propagatesDeletesAtEndOfEvent()
whether or not the context propagates deletes to related objects at the end of the event, or only at save time
Original signature : -(BOOL)propagatesDeletesAtEndOfEvent
setPropagatesDeletesAtEndOfEvent
public abstract void setPropagatesDeletesAtEndOfEvent(boolean flag)
Original signature : -(void)setPropagatesDeletesAtEndOfEvent:(BOOL)
The default is YES.
retainsRegisteredObjects
public abstract boolean retainsRegisteredObjects()
whether or not the context holds a retain on all registered objects, or only upon objects necessary for a pending save (inserted, updated, deleted, or locked)
Original signature : -(BOOL)retainsRegisteredObjects
setRetainsRegisteredObjects
public abstract void setRetainsRegisteredObjects(boolean flag)
Original signature : -(void)setRetainsRegisteredObjects:(BOOL)
The default is NO.
stalenessInterval
public abstract double stalenessInterval()
Staleness interval is the relative time until cached data should be considered stale. The value is applied on a per object basis. For example, a value of 300.0 informs the context to utilize cached information for no more than 5 minutes after that object was originally fetched. This does not affect objects currently in use. Principly, this controls whether fulfilling a fault uses data previously fetched by the application, or issues a new fetch. It is a hint which may not be supported by all persistent store types.
Original signature : -(NSTimeInterval)stalenessInterval
setStalenessInterval
public abstract void setStalenessInterval(double expiration)
Original signature : -(void)setStalenessInterval:(NSTimeInterval)
a negative value is considered infinite. The default is infinite staleness.
setMergePolicy
public abstract void setMergePolicy(org.rococoa.ID mergePolicy)
Original signature : -(void)setMergePolicy:(id)
acceptable merge policies are listed above as id constants
Original signature : -(id)mergePolicy
default: NSErrorMergePolicy
obtainPermanentIDsForObjects_error
public abstract boolean obtainPermanentIDsForObjects_error(NSArray objects,
PointerByReference error)
Converts the object IDs of the specified objects to permanent IDs. This implementation will convert the object ID of each managed object in the specified array to a permanent ID. Any object in the target array with a permanent ID will be ignored; additionally, any managed object in the array not already assigned to a store will be assigned, based on the same rules Core Data uses for assignment during a save operation (first writable store supporting the entity, and appropriate for the instance and its related items.) Although the object will have a permanent ID, it will still respond positively to -isInserted until it is saved. If an error is encountered obtaining an identifier, the return value will be NO.
Original signature : -(BOOL)obtainPermanentIDsForObjects:(NSArray*) error:(NSError**)
mergeChangesFromContextDidSaveNotification
public abstract void mergeChangesFromContextDidSaveNotification(NSNotification notification)
Merges the changes specified in the NSManagedObjectContextDidSaveNotification into the context. This method will refresh any objects which have been updated in the other context, fault in any newly inserted objects, and invoke deleteObject: on those which have been deleted.
Original signature : -(void)mergeChangesFromContextDidSaveNotification:(NSNotification*)