| Modifier and Type | Class and Description |
|---|---|
static interface |
NSManagedObjectContext.Block_performBlock |
static interface |
NSManagedObjectContext.Block_performBlockAndWait |
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
NSManagedObjectContext(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
accessInstanceVariablesDirectly() |
static NSManagedObjectContext |
alloc() |
static NSManagedObjectContext |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
void |
assignObjectToPersistentStore(java.lang.Object object,
NSPersistentStore store)
specifies the store a newly inserted object will be saved in.
|
boolean |
automaticallyMergesChangesFromParent()
Whether the context automatically merges changes saved to its coordinator or parent context.
|
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
static void |
cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget) |
static void |
cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument) |
static NSArray<java.lang.String> |
classFallbacksForKeyedArchiver() |
static org.moe.natj.objc.Class |
classForKeyedUnarchiver() |
long |
concurrencyType() |
long |
countForFetchRequestError(NSFetchRequest<?> request,
org.moe.natj.general.ptr.Ptr<NSError> error)
returns the number of objects a fetch request would have returned if it had been passed to -executeFetchRequest:error:.
|
static java.lang.String |
debugDescription_static() |
NSSet<? extends NSManagedObject> |
deletedObjects() |
void |
deleteObject(NSManagedObject object) |
static java.lang.String |
description_static() |
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.
|
void |
encodeWithCoder(NSCoder coder) |
NSArray<?> |
executeFetchRequestError(NSFetchRequest<?> request,
org.moe.natj.general.ptr.Ptr<NSError> 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:
|
NSPersistentStoreResult |
executeRequestError(NSPersistentStoreRequest request,
org.moe.natj.general.ptr.Ptr<NSError> error)
Method to pass a request to the store without affecting the contents of the managed object context.
|
NSManagedObject |
existingObjectWithIDError(NSManagedObjectID objectID,
org.moe.natj.general.ptr.Ptr<NSError> error)
returns the object for the specified ID if it is already registered in the context, or faults the object into the context.
|
boolean |
hasChanges() |
static long |
hash_static() |
NSManagedObjectContext |
init()
Deprecated.
|
NSManagedObjectContext |
initWithCoder(NSCoder coder)
NS_DESIGNATED_INITIALIZER
|
NSManagedObjectContext |
initWithConcurrencyType(long ct) |
NSSet<? extends NSManagedObject> |
insertedObjects() |
void |
insertObject(NSManagedObject object) |
static NSObject.Function_instanceMethodForSelector_ret |
instanceMethodForSelector(org.moe.natj.objc.SEL aSelector) |
static NSMethodSignature |
instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
instancesRespondToSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
void |
lock()
Deprecated.
|
void |
mergeChangesFromContextDidSaveNotification(NSNotification notification)
Merges the changes specified in notification object received from another context's NSManagedObjectContextDidSaveNotification into the receiver.
|
static void |
mergeChangesFromRemoteContextSaveIntoContexts(NSDictionary<?,?> changeNotificationData,
NSArray<? extends NSManagedObjectContext> contexts)
Similar to mergeChangesFromContextDidSaveNotification, this method handles changes from potentially other processes or serialized state.
|
java.lang.Object |
mergePolicy()
default: NSErrorMergePolicy
|
java.lang.String |
name()
custom label for a context.
|
static NSManagedObjectContext |
new_objc()
Deprecated.
|
NSManagedObject |
objectRegisteredForID(NSManagedObjectID objectID)
returns the object for the specified ID if it is registered in the context already or nil.
|
NSManagedObject |
objectWithID(NSManagedObjectID objectID)
returns the object for the specified ID if it is already registered, otherwise it creates a fault corresponding to that objectID.
|
void |
observeValueForKeyPathOfObjectChangeContext(java.lang.String keyPath,
java.lang.Object object,
NSDictionary<java.lang.String,?> change,
org.moe.natj.general.ptr.VoidPtr context)
key-value observation
|
boolean |
obtainPermanentIDsForObjectsError(NSArray<? extends NSManagedObject> objects,
org.moe.natj.general.ptr.Ptr<NSError> error)
Converts the object IDs of the specified objects to permanent IDs.
|
NSManagedObjectContext |
parentContext() |
void |
performBlock(NSManagedObjectContext.Block_performBlock block)
asynchronously performs the block on the context's queue.
|
void |
performBlockAndWait(NSManagedObjectContext.Block_performBlockAndWait block)
synchronously performs the block on the context's queue.
|
NSPersistentStoreCoordinator |
persistentStoreCoordinator()
coordinator which provides model and handles persistency (multiple contexts can share a coordinator)
|
void |
processPendingChanges()
usually contexts process changes to the object graph coalesced at the end of the event - this method triggers it explicitly
|
boolean |
propagatesDeletesAtEndOfEvent()
The default is YES.
|
NSQueryGenerationToken |
queryGenerationToken()
Return the query generation currently in use by this context.
|
void |
redo() |
void |
refreshAllObjects()
calls -refreshObject:mergeChanges: on all currently registered objects with this context.
|
void |
refreshObjectMergeChanges(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)
|
NSSet<? extends NSManagedObject> |
registeredObjects() |
void |
reset() |
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
boolean |
retainsRegisteredObjects()
The default is NO.
|
void |
rollback() |
boolean |
save(org.moe.natj.general.ptr.Ptr<NSError> error) |
void |
setAutomaticallyMergesChangesFromParent(boolean value)
Whether the context automatically merges changes saved to its coordinator or parent context.
|
void |
setMergePolicy(java.lang.Object value)
default: NSErrorMergePolicy
|
void |
setName(java.lang.String value)
custom label for a context.
|
void |
setParentContext(NSManagedObjectContext value) |
void |
setPersistentStoreCoordinator(NSPersistentStoreCoordinator value)
coordinator which provides model and handles persistency (multiple contexts can share a coordinator)
|
void |
setPropagatesDeletesAtEndOfEvent(boolean value)
The default is YES.
|
boolean |
setQueryGenerationFromTokenError(NSQueryGenerationToken generation,
org.moe.natj.general.ptr.Ptr<NSError> error)
Set the query generation this context should use.
|
void |
setRetainsRegisteredObjects(boolean value)
The default is NO.
|
void |
setShouldDeleteInaccessibleFaults(boolean value)
set the rule to handle inaccessible faults.
|
void |
setStalenessInterval(double value)
a negative value is considered infinite.
|
void |
setTransactionAuthor(java.lang.String value)
Set the author for the context, this will be used as an identifier in the Persistent History Transactions (NSPersistentHistoryTransaction)
|
void |
setUndoManager(NSUndoManager value) |
static void |
setVersion_static(long aVersion) |
boolean |
shouldDeleteInaccessibleFaults()
set the rule to handle inaccessible faults.
|
boolean |
shouldHandleInaccessibleFaultForObjectIDTriggeredByProperty(NSManagedObject fault,
NSManagedObjectID oid,
NSPropertyDescription property)
this method will not be called from APIs which return an NSError like -existingObjectWithID:error: nor for managed objects with a nil context (e.g.
|
double |
stalenessInterval()
a negative value is considered infinite.
|
static org.moe.natj.objc.Class |
superclass_static() |
java.lang.String |
transactionAuthor()
Set the author for the context, this will be used as an identifier in the Persistent History Transactions (NSPersistentHistoryTransaction)
|
boolean |
tryLock()
Deprecated.
|
void |
undo() |
NSUndoManager |
undoManager() |
void |
unlock()
Deprecated.
|
NSSet<? extends NSManagedObject> |
updatedObjects() |
NSMutableDictionary<?,?> |
userInfo() |
static long |
version_static() |
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKeyprotected NSManagedObjectContext(org.moe.natj.general.Pointer peer)
public static boolean accessInstanceVariablesDirectly()
public static NSManagedObjectContext alloc()
public static NSManagedObjectContext allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public static java.lang.String debugDescription_static()
public static java.lang.String description_static()
public static long hash_static()
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public static void mergeChangesFromRemoteContextSaveIntoContexts(NSDictionary<?,?> changeNotificationData, NSArray<? extends NSManagedObjectContext> contexts)
@Deprecated public static NSManagedObjectContext new_objc()
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public static void setVersion_static(long aVersion)
public static org.moe.natj.objc.Class superclass_static()
public static long version_static()
public void assignObjectToPersistentStore(java.lang.Object object,
NSPersistentStore store)
public boolean automaticallyMergesChangesFromParent()
public long concurrencyType()
public long countForFetchRequestError(NSFetchRequest<?> request, org.moe.natj.general.ptr.Ptr<NSError> error)
public void deleteObject(NSManagedObject object)
public NSSet<? extends NSManagedObject> deletedObjects()
public void detectConflictsForObject(NSManagedObject object)
public void encodeWithCoder(NSCoder coder)
encodeWithCoder in interface NSCodingpublic NSArray<?> executeFetchRequestError(NSFetchRequest<?> request, org.moe.natj.general.ptr.Ptr<NSError> error)
public NSPersistentStoreResult executeRequestError(NSPersistentStoreRequest request, org.moe.natj.general.ptr.Ptr<NSError> error)
public NSManagedObject existingObjectWithIDError(NSManagedObjectID objectID, org.moe.natj.general.ptr.Ptr<NSError> error)
public boolean hasChanges()
@Deprecated public NSManagedObjectContext init()
public NSManagedObjectContext initWithCoder(NSCoder coder)
NSCodinginitWithCoder in interface NSCodingpublic NSManagedObjectContext initWithConcurrencyType(long ct)
public void insertObject(NSManagedObject object)
public NSSet<? extends NSManagedObject> insertedObjects()
public void mergeChangesFromContextDidSaveNotification(NSNotification notification)
public java.lang.Object mergePolicy()
public java.lang.String name()
public NSManagedObject objectRegisteredForID(NSManagedObjectID objectID)
public NSManagedObject objectWithID(NSManagedObjectID objectID)
public void observeValueForKeyPathOfObjectChangeContext(java.lang.String keyPath,
java.lang.Object object,
NSDictionary<java.lang.String,?> change,
org.moe.natj.general.ptr.VoidPtr context)
observeValueForKeyPathOfObjectChangeContext in class NSObjectpublic boolean obtainPermanentIDsForObjectsError(NSArray<? extends NSManagedObject> objects, org.moe.natj.general.ptr.Ptr<NSError> error)
public NSManagedObjectContext parentContext()
public void performBlock(NSManagedObjectContext.Block_performBlock block)
public void performBlockAndWait(NSManagedObjectContext.Block_performBlockAndWait block)
public NSPersistentStoreCoordinator persistentStoreCoordinator()
public void processPendingChanges()
public boolean propagatesDeletesAtEndOfEvent()
public NSQueryGenerationToken queryGenerationToken()
All child contexts will return nil.
public void redo()
public void refreshAllObjects()
public void refreshObjectMergeChanges(NSManagedObject object, boolean flag)
public NSSet<? extends NSManagedObject> registeredObjects()
public void reset()
public boolean retainsRegisteredObjects()
public void rollback()
public boolean save(org.moe.natj.general.ptr.Ptr<NSError> error)
public void setAutomaticallyMergesChangesFromParent(boolean value)
public void setMergePolicy(java.lang.Object value)
public void setName(java.lang.String value)
public void setParentContext(NSManagedObjectContext value)
public void setPersistentStoreCoordinator(NSPersistentStoreCoordinator value)
public void setPropagatesDeletesAtEndOfEvent(boolean value)
public boolean setQueryGenerationFromTokenError(NSQueryGenerationToken generation, org.moe.natj.general.ptr.Ptr<NSError> error)
Query generations are for fetched data only; they are not used during saving. If a pinned context saves, its query generation will be updated after the save. Executing a NSBatchUpdateRequest or NSBatchDeleteRequest will not cause the query generation to advance, since these do not otherwise consider or affect the managed object context's content.
All nested contexts will defer to their parent context’s data. It is a programmer error to try to set the queryGenerationToken on a child context.
Query generations are tracked across the union of stores. Additions to the persistent store coordinator's persistent stores will be ignored until the context's query generation is updated to include them.
May partially fail if one or more stores being tracked by the token are removed from the persistent store coordinator.
public void setRetainsRegisteredObjects(boolean value)
public void setShouldDeleteInaccessibleFaults(boolean value)
public void setStalenessInterval(double value)
public void setUndoManager(NSUndoManager value)
public boolean shouldDeleteInaccessibleFaults()
public boolean shouldHandleInaccessibleFaultForObjectIDTriggeredByProperty(NSManagedObject fault, NSManagedObjectID oid, NSPropertyDescription property)
public double stalenessInterval()
@Deprecated public boolean tryLock()
public void undo()
public NSUndoManager undoManager()
public NSSet<? extends NSManagedObject> updatedObjects()
public NSMutableDictionary<?,?> userInfo()
public void setTransactionAuthor(java.lang.String value)
public java.lang.String transactionAuthor()