Package apple.coredata
Class NSManagedObjectContext
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.coredata.NSManagedObjectContext
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceNSManagedObjectContext.Block_performBlockstatic interfaceNSManagedObjectContext.Block_performBlockAndWait-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Block_accessibilityActivateBlock_ret, NSObject.Block_accessibilityActivationPointBlock_ret, NSObject.Block_accessibilityAttributedHintBlock_ret, NSObject.Block_accessibilityAttributedLabelBlock_ret, NSObject.Block_accessibilityAttributedUserInputLabelsBlock_ret, NSObject.Block_accessibilityAttributedValueBlock_ret, NSObject.Block_accessibilityContainerTypeBlock_ret, NSObject.Block_accessibilityCustomActionsBlock_ret, NSObject.Block_accessibilityCustomRotorsBlock_ret, NSObject.Block_accessibilityDecrementBlock_ret, NSObject.Block_accessibilityElementsBlock_ret, NSObject.Block_accessibilityElementsHiddenBlock_ret, NSObject.Block_accessibilityFrameBlock_ret, NSObject.Block_accessibilityHeaderElementsBlock_ret, NSObject.Block_accessibilityHintBlock_ret, NSObject.Block_accessibilityIdentifierBlock_ret, NSObject.Block_accessibilityIncrementBlock_ret, NSObject.Block_accessibilityLabelBlock_ret, NSObject.Block_accessibilityLanguageBlock_ret, NSObject.Block_accessibilityMagicTapBlock_ret, NSObject.Block_accessibilityNavigationStyleBlock_ret, NSObject.Block_accessibilityPathBlock_ret, NSObject.Block_accessibilityPerformEscapeBlock_ret, NSObject.Block_accessibilityRespondsToUserInteractionBlock_ret, NSObject.Block_accessibilityShouldGroupAccessibilityChildrenBlock_ret, NSObject.Block_accessibilityTextualContextBlock_ret, NSObject.Block_accessibilityTraitsBlock_ret, NSObject.Block_accessibilityUserInputLabelsBlock_ret, NSObject.Block_accessibilityValueBlock_ret, NSObject.Block_accessibilityViewIsModalBlock_ret, NSObject.Block_automationElementsBlock_ret, NSObject.Block_isAccessibilityElementBlock_ret, NSObject.Block_setAccessibilityActivateBlock, NSObject.Block_setAccessibilityActivationPointBlock, NSObject.Block_setAccessibilityAttributedHintBlock, NSObject.Block_setAccessibilityAttributedLabelBlock, NSObject.Block_setAccessibilityAttributedUserInputLabelsBlock, NSObject.Block_setAccessibilityAttributedValueBlock, NSObject.Block_setAccessibilityContainerTypeBlock, NSObject.Block_setAccessibilityCustomActionsBlock, NSObject.Block_setAccessibilityCustomRotorsBlock, NSObject.Block_setAccessibilityDecrementBlock, NSObject.Block_setAccessibilityElementsBlock, NSObject.Block_setAccessibilityElementsHiddenBlock, NSObject.Block_setAccessibilityFrameBlock, NSObject.Block_setAccessibilityHeaderElementsBlock, NSObject.Block_setAccessibilityHintBlock, NSObject.Block_setAccessibilityIdentifierBlock, NSObject.Block_setAccessibilityIncrementBlock, NSObject.Block_setAccessibilityLabelBlock, NSObject.Block_setAccessibilityLanguageBlock, NSObject.Block_setAccessibilityMagicTapBlock, NSObject.Block_setAccessibilityNavigationStyleBlock, NSObject.Block_setAccessibilityPathBlock, NSObject.Block_setAccessibilityPerformEscapeBlock, NSObject.Block_setAccessibilityRespondsToUserInteractionBlock, NSObject.Block_setAccessibilityShouldGroupAccessibilityChildrenBlock, NSObject.Block_setAccessibilityTextualContextBlock, NSObject.Block_setAccessibilityTraitsBlock, NSObject.Block_setAccessibilityUserInputLabelsBlock, NSObject.Block_setAccessibilityValueBlock, NSObject.Block_setAccessibilityViewIsModalBlock, NSObject.Block_setAutomationElementsBlock, NSObject.Block_setIsAccessibilityElementBlock, NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNSManagedObjectContext(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static booleanaccessInstanceVariablesDirectly()static NSManagedObjectContextalloc()static NSManagedObjectContextallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)voidassignObjectToPersistentStore(@NotNull java.lang.Object object, @NotNull NSPersistentStore store)specifies the store a newly inserted object will be saved in.booleanautomaticallyMergesChangesFromParent()Whether the context automatically merges changes saved to its coordinator or parent context.static booleanautomaticallyNotifiesObserversForKey(@NotNull java.lang.String key)static voidcancelPreviousPerformRequestsWithTarget(@NotNull java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(@NotNull java.lang.Object aTarget, @NotNull org.moe.natj.objc.SEL aSelector, @Nullable java.lang.Object anArgument)static @NotNull NSArray<java.lang.String>classFallbacksForKeyedArchiver()static @NotNull org.moe.natj.objc.ClassclassForKeyedUnarchiver()longconcurrencyType()API-Since: 5.0longcountForFetchRequestError(@NotNull NSFetchRequest<?> request, @Nullable 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.StringdebugDescription_static()@NotNull NSSet<? extends NSManagedObject>deletedObjects()voiddeleteObject(@NotNull NSManagedObject object)static java.lang.Stringdescription_static()voiddetectConflictsForObject(@NotNull 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.voidencodeWithCoder(@NotNull NSCoder coder)@Nullable NSArray<?>executeFetchRequestError(@NotNull NSFetchRequest<?> request, @Nullable 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:@Nullable NSPersistentStoreResultexecuteRequestError(@NotNull NSPersistentStoreRequest request, @Nullable 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.@Nullable NSManagedObjectexistingObjectWithIDError(@NotNull NSManagedObjectID objectID, @Nullable 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.booleanhasChanges()static longhash_static()NSManagedObjectContextinit()Deprecated.NSManagedObjectContextinitWithCoder(@NotNull NSCoder coder)NS_DESIGNATED_INITIALIZERNSManagedObjectContextinitWithConcurrencyType(long ct)API-Since: 5.0@NotNull NSSet<? extends NSManagedObject>insertedObjects()voidinsertObject(@NotNull NSManagedObject object)static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static @NotNull NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(@NotNull java.lang.String key)voidlock()Deprecated.voidmergeChangesFromContextDidSaveNotification(@NotNull NSNotification notification)Merges the changes specified in notification object received from another context's NSManagedObjectContextDidSaveNotification into the receiver.static voidmergeChangesFromRemoteContextSaveIntoContexts(@NotNull NSDictionary<?,?> changeNotificationData, @NotNull NSArray<? extends NSManagedObjectContext> contexts)Similar to mergeChangesFromContextDidSaveNotification, this method handles changes from potentially other processes or serialized state.@NotNull java.lang.ObjectmergePolicy()default: NSErrorMergePolicy@Nullable java.lang.Stringname()custom label for a context.static NSManagedObjectContextnew_objc()Deprecated.@Nullable NSManagedObjectobjectRegisteredForID(@NotNull NSManagedObjectID objectID)returns the object for the specified ID if it is registered in the context already or nil.@NotNull NSManagedObjectobjectWithID(@NotNull NSManagedObjectID objectID)returns the object for the specified ID if it is already registered, otherwise it creates a fault corresponding to that objectID.voidobserveValueForKeyPathOfObjectChangeContext(@Nullable java.lang.String keyPath, @Nullable java.lang.Object object, @Nullable NSDictionary<java.lang.String,?> change, @Nullable org.moe.natj.general.ptr.VoidPtr context)key-value observationbooleanobtainPermanentIDsForObjectsError(@NotNull NSArray<? extends NSManagedObject> objects, @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)Converts the object IDs of the specified objects to permanent IDs.@Nullable NSManagedObjectContextparentContext()API-Since: 5.0voidperformBlock(@NotNull NSManagedObjectContext.Block_performBlock block)asynchronously performs the block on the context's queue.voidperformBlockAndWait(@NotNull NSManagedObjectContext.Block_performBlockAndWait block)synchronously performs the block on the context's queue.@Nullable NSPersistentStoreCoordinatorpersistentStoreCoordinator()coordinator which provides model and handles persistency (multiple contexts can share a coordinator)voidprocessPendingChanges()usually contexts process changes to the object graph coalesced at the end of the event - this method triggers it explicitlybooleanpropagatesDeletesAtEndOfEvent()The default is YES.@Nullable NSQueryGenerationTokenqueryGenerationToken()Return the query generation currently in use by this context.voidredo()voidrefreshAllObjects()calls -refreshObject:mergeChanges: on all currently registered objects with this context.voidrefreshObjectMergeChanges(@NotNull 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)@NotNull NSSet<? extends NSManagedObject>registeredObjects()voidreset()static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)booleanretainsRegisteredObjects()The default is NO.voidrollback()booleansave(@Nullable org.moe.natj.general.ptr.Ptr<NSError> error)voidsetAutomaticallyMergesChangesFromParent(boolean value)Whether the context automatically merges changes saved to its coordinator or parent context.voidsetMergePolicy(@NotNull java.lang.Object value)default: NSErrorMergePolicyvoidsetName(@Nullable java.lang.String value)custom label for a context.voidsetParentContext(@Nullable NSManagedObjectContext value)API-Since: 5.0voidsetPersistentStoreCoordinator(@Nullable NSPersistentStoreCoordinator value)coordinator which provides model and handles persistency (multiple contexts can share a coordinator)voidsetPropagatesDeletesAtEndOfEvent(boolean value)The default is YES.booleansetQueryGenerationFromTokenError(@Nullable NSQueryGenerationToken generation, @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)Set the query generation this context should use.voidsetRetainsRegisteredObjects(boolean value)The default is NO.voidsetShouldDeleteInaccessibleFaults(boolean value)set the rule to handle inaccessible faults.voidsetStalenessInterval(double value)a negative value is considered infinite.voidsetTransactionAuthor(@Nullable java.lang.String value)Set the author for the context, this will be used as an identifier in the Persistent History Transactions (NSPersistentHistoryTransaction) API-Since: 11.0voidsetUndoManager(@Nullable NSUndoManager value)static voidsetVersion_static(long aVersion)booleanshouldDeleteInaccessibleFaults()set the rule to handle inaccessible faults.booleanshouldHandleInaccessibleFaultForObjectIDTriggeredByProperty(@NotNull NSManagedObject fault, @NotNull NSManagedObjectID oid, @Nullable 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.doublestalenessInterval()a negative value is considered infinite.static org.moe.natj.objc.Classsuperclass_static()@Nullable java.lang.StringtransactionAuthor()Set the author for the context, this will be used as an identifier in the Persistent History Transactions (NSPersistentHistoryTransaction) API-Since: 11.0booleantryLock()Deprecated.voidundo()@Nullable NSUndoManagerundoManager()voidunlock()Deprecated.@NotNull NSSet<? extends NSManagedObject>updatedObjects()@NotNull NSMutableDictionary<?,?>userInfo()API-Since: 5.0static booleanuseStoredAccessor()Deprecated.static longversion_static()-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivateBlock, accessibilityActivationPoint, accessibilityActivationPointBlock, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedHintBlock, accessibilityAttributedLabel, accessibilityAttributedLabelBlock, accessibilityAttributedUserInputLabels, accessibilityAttributedUserInputLabelsBlock, accessibilityAttributedValue, accessibilityAttributedValueBlock, accessibilityContainerType, accessibilityContainerTypeBlock, accessibilityCustomActions, accessibilityCustomActionsBlock, accessibilityCustomRotors, accessibilityCustomRotorsBlock, accessibilityDecrement, accessibilityDecrementBlock, accessibilityDirectTouchOptions, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsBlock, accessibilityElementsHidden, accessibilityElementsHiddenBlock, accessibilityFrame, accessibilityFrameBlock, accessibilityHeaderElementsBlock, accessibilityHint, accessibilityHintBlock, accessibilityIdentifierBlock, accessibilityIncrement, accessibilityIncrementBlock, accessibilityLabel, accessibilityLabelBlock, accessibilityLanguage, accessibilityLanguageBlock, accessibilityMagicTapBlock, accessibilityNavigationStyle, accessibilityNavigationStyleBlock, accessibilityPath, accessibilityPathBlock, accessibilityPerformEscape, accessibilityPerformEscapeBlock, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityRespondsToUserInteractionBlock, accessibilityScroll, accessibilityShouldGroupAccessibilityChildrenBlock, accessibilityTextualContext, accessibilityTextualContextBlock, accessibilityTraits, accessibilityTraitsBlock, accessibilityUserInputLabels, accessibilityUserInputLabelsBlock, accessibilityValue, accessibilityValueBlock, accessibilityViewIsModal, accessibilityViewIsModalBlock, accessibilityZoomInAtPoint, accessibilityZoomOutAtPoint, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, automationElements, automationElementsBlock, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hash, indexOfAccessibilityElement, isAccessibilityElement, isAccessibilityElementBlock, 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, setAccessibilityActivateBlock, setAccessibilityActivationPoint, setAccessibilityActivationPointBlock, setAccessibilityAttributedHint, setAccessibilityAttributedHintBlock, setAccessibilityAttributedLabel, setAccessibilityAttributedLabelBlock, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedUserInputLabelsBlock, setAccessibilityAttributedValue, setAccessibilityAttributedValueBlock, setAccessibilityContainerType, setAccessibilityContainerTypeBlock, setAccessibilityCustomActions, setAccessibilityCustomActionsBlock, setAccessibilityCustomRotors, setAccessibilityCustomRotorsBlock, setAccessibilityDecrementBlock, setAccessibilityDirectTouchOptions, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsBlock, setAccessibilityElementsHidden, setAccessibilityElementsHiddenBlock, setAccessibilityFrame, setAccessibilityFrameBlock, setAccessibilityHeaderElementsBlock, setAccessibilityHint, setAccessibilityHintBlock, setAccessibilityIdentifierBlock, setAccessibilityIncrementBlock, setAccessibilityLabel, setAccessibilityLabelBlock, setAccessibilityLanguage, setAccessibilityLanguageBlock, setAccessibilityMagicTapBlock, setAccessibilityNavigationStyle, setAccessibilityNavigationStyleBlock, setAccessibilityPath, setAccessibilityPathBlock, setAccessibilityPerformEscapeBlock, setAccessibilityRespondsToUserInteraction, setAccessibilityRespondsToUserInteractionBlock, setAccessibilityShouldGroupAccessibilityChildrenBlock, setAccessibilityTextualContext, setAccessibilityTextualContextBlock, setAccessibilityTraits, setAccessibilityTraitsBlock, setAccessibilityUserInputLabels, setAccessibilityUserInputLabelsBlock, setAccessibilityValue, setAccessibilityValueBlock, setAccessibilityViewIsModal, setAccessibilityViewIsModalBlock, setAutomationElements, setAutomationElementsBlock, setIsAccessibilityElement, setIsAccessibilityElementBlock, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, storedValueForKey, superclass, takeStoredValueForKey, takeValueForKey, takeValueForKeyPath, takeValuesFromDictionary, unableToSetNilForKey, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, valuesForKeys, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static NSManagedObjectContext alloc()
-
allocWithZone
public static NSManagedObjectContext allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(@NotNull @NotNull java.lang.String key)
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(@NotNull @NotNull java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(@NotNull @NotNull java.lang.Object aTarget, @NotNull @NotNull org.moe.natj.objc.SEL aSelector, @Nullable @Nullable java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
@NotNull public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
@NotNull public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
description_static
public static java.lang.String description_static()
-
hash_static
public static long hash_static()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
instanceMethodSignatureForSelector
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
-
instancesRespondToSelector
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
-
isSubclassOfClass
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
-
keyPathsForValuesAffectingValueForKey
@NotNull public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(@NotNull @NotNull java.lang.String key)
-
mergeChangesFromRemoteContextSaveIntoContexts
public static void mergeChangesFromRemoteContextSaveIntoContexts(@NotNull @NotNull NSDictionary<?,?> changeNotificationData, @NotNull @NotNull NSArray<? extends NSManagedObjectContext> contexts)Similar to mergeChangesFromContextDidSaveNotification, this method handles changes from potentially other processes or serialized state. It more efficiently merges changes into multiple contexts, as well as nested context. The keys in the dictionary should be one those from an NSManagedObjectContextObjectsDidChangeNotification: NSInsertedObjectsKey, NSUpdatedObjectsKey, etc. the values should be an NSArray of either NSManagedObjectID or NSURL objects conforming to valid results from -URIRepresentation API-Since: 9.0
-
new_objc
@Deprecated public static NSManagedObjectContext new_objc()
Deprecated.API-Since: 3.0 Deprecated-Since: 9.0 Deprecated-Message: Use -initWithConcurrencyType: instead
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
setVersion_static
public static void setVersion_static(long aVersion)
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
version_static
public static long version_static()
-
assignObjectToPersistentStore
public void assignObjectToPersistentStore(@NotNull @NotNull java.lang.Object object, @NotNull @NotNull 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.
-
automaticallyMergesChangesFromParent
public boolean automaticallyMergesChangesFromParent()
Whether the context automatically merges changes saved to its coordinator or parent context. Setting this property to YES when the context is pinned to a non-current query generation is not supported. API-Since: 10.0
-
concurrencyType
public long concurrencyType()
API-Since: 5.0
-
countForFetchRequestError
public long countForFetchRequestError(@NotNull @NotNull NSFetchRequest<?> request, @Nullable @Nullable 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:. If an error occurred during the processing of the request, this method will return NSNotFound. API-Since: 3.0
-
deleteObject
public void deleteObject(@NotNull @NotNull NSManagedObject object)
-
deletedObjects
@NotNull public @NotNull NSSet<? extends NSManagedObject> deletedObjects()
-
detectConflictsForObject
public void detectConflictsForObject(@NotNull @NotNull 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.
-
encodeWithCoder
public void encodeWithCoder(@NotNull @NotNull NSCoder coder)- Specified by:
encodeWithCoderin interfaceNSCoding
-
executeFetchRequestError
@Nullable public @Nullable NSArray<?> executeFetchRequestError(@NotNull @NotNull NSFetchRequest<?> request, @Nullable @Nullable 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:
-
executeRequestError
@Nullable public @Nullable NSPersistentStoreResult executeRequestError(@NotNull @NotNull NSPersistentStoreRequest request, @Nullable @Nullable 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. Will return an NSPersistentStoreResult which may contain additional information about the result of the action (ie a batch update result may contain the object IDs of the objects that were modified during the update). A request may succeed in some stores and fail in others. In this case, the error will contain information about each individual store failure. Will always reject NSSaveChangesRequests. API-Since: 8.0
-
existingObjectWithIDError
@Nullable public @Nullable NSManagedObject existingObjectWithIDError(@NotNull @NotNull NSManagedObjectID objectID, @Nullable @Nullable 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. It might perform I/O if the data is uncached. If the object cannot be fetched, or does not exist, or cannot be faulted, it returns nil. Unlike -objectWithID: it never returns a fault. API-Since: 3.0
-
hasChanges
public boolean hasChanges()
-
init
@Deprecated public NSManagedObjectContext init()
Deprecated.API-Since: 3.0 Deprecated-Since: 9.0 Deprecated-Message: Use -initWithConcurrencyType: instead
-
initWithCoder
public NSManagedObjectContext initWithCoder(@NotNull @NotNull NSCoder coder)
Description copied from interface:NSCodingNS_DESIGNATED_INITIALIZER- Specified by:
initWithCoderin interfaceNSCoding
-
initWithConcurrencyType
public NSManagedObjectContext initWithConcurrencyType(long ct)
API-Since: 5.0
-
insertObject
public void insertObject(@NotNull @NotNull NSManagedObject object)
-
insertedObjects
@NotNull public @NotNull NSSet<? extends NSManagedObject> insertedObjects()
-
mergeChangesFromContextDidSaveNotification
public void mergeChangesFromContextDidSaveNotification(@NotNull @NotNull NSNotification notification)Merges the changes specified in notification object received from another context's NSManagedObjectContextDidSaveNotification into the receiver. 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. The developer is only responsible for the thread safety of the receiver. API-Since: 3.0
-
mergePolicy
@NotNull public @NotNull java.lang.Object mergePolicy()
default: NSErrorMergePolicy
-
name
@Nullable public @Nullable java.lang.String name()
custom label for a context. NSPrivateQueueConcurrencyType contexts will set the label on their queue API-Since: 8.0
-
objectRegisteredForID
@Nullable public @Nullable NSManagedObject objectRegisteredForID(@NotNull @NotNull NSManagedObjectID objectID)
returns the object for the specified ID if it is registered in the context already or nil. It never performs I/O.
-
objectWithID
@NotNull public @NotNull NSManagedObject objectWithID(@NotNull @NotNull NSManagedObjectID objectID)
returns the object for the specified ID if it is already registered, otherwise it creates a fault corresponding to that objectID. It never returns nil, and never performs I/O. The object specified by objectID is assumed to exist, and if that assumption is wrong the fault may throw an exception when used.
-
observeValueForKeyPathOfObjectChangeContext
public void observeValueForKeyPathOfObjectChangeContext(@Nullable @Nullable java.lang.String keyPath, @Nullable @Nullable java.lang.Object object, @Nullable @Nullable NSDictionary<java.lang.String,?> change, @Nullable @Nullable org.moe.natj.general.ptr.VoidPtr context)key-value observation- Overrides:
observeValueForKeyPathOfObjectChangeContextin classNSObject
-
obtainPermanentIDsForObjectsError
public boolean obtainPermanentIDsForObjectsError(@NotNull @NotNull NSArray<? extends NSManagedObject> objects, @Nullable @Nullable org.moe.natj.general.ptr.Ptr<NSError> 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. API-Since: 3.0
-
parentContext
@Nullable public @Nullable NSManagedObjectContext parentContext()
API-Since: 5.0
-
performBlock
public void performBlock(@NotNull @NotNull NSManagedObjectContext.Block_performBlock block)asynchronously performs the block on the context's queue. Encapsulates an autorelease pool and a call to processPendingChanges API-Since: 5.0
-
performBlockAndWait
public void performBlockAndWait(@NotNull @NotNull NSManagedObjectContext.Block_performBlockAndWait block)synchronously performs the block on the context's queue. May safely be called reentrantly. API-Since: 5.0
-
persistentStoreCoordinator
@Nullable public @Nullable NSPersistentStoreCoordinator persistentStoreCoordinator()
coordinator which provides model and handles persistency (multiple contexts can share a coordinator)
-
processPendingChanges
public void processPendingChanges()
usually contexts process changes to the object graph coalesced at the end of the event - this method triggers it explicitly
-
propagatesDeletesAtEndOfEvent
public boolean propagatesDeletesAtEndOfEvent()
The default is YES.
-
queryGenerationToken
@Nullable public @Nullable NSQueryGenerationToken queryGenerationToken()
Return the query generation currently in use by this context. Will be one of the following: - nil, default value => this context is not using generational querying - an opaque token => specifies the generation of data this context is vending All child contexts will return nil. API-Since: 10.0
-
redo
public void redo()
-
refreshAllObjects
public void refreshAllObjects()
calls -refreshObject:mergeChanges: on all currently registered objects with this context. It handles dirtied objects and clearing the context reference queue API-Since: 8.3
-
refreshObjectMergeChanges
public void refreshObjectMergeChanges(@NotNull @NotNull 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)
-
registeredObjects
@NotNull public @NotNull NSSet<? extends NSManagedObject> registeredObjects()
-
reset
public void reset()
-
retainsRegisteredObjects
public boolean retainsRegisteredObjects()
The default is NO.
-
rollback
public void rollback()
-
save
public boolean save(@Nullable @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
-
setAutomaticallyMergesChangesFromParent
public void setAutomaticallyMergesChangesFromParent(boolean value)
Whether the context automatically merges changes saved to its coordinator or parent context. Setting this property to YES when the context is pinned to a non-current query generation is not supported. API-Since: 10.0
-
setMergePolicy
public void setMergePolicy(@NotNull @NotNull java.lang.Object value)default: NSErrorMergePolicy
-
setName
public void setName(@Nullable @Nullable java.lang.String value)custom label for a context. NSPrivateQueueConcurrencyType contexts will set the label on their queue API-Since: 8.0
-
setParentContext
public void setParentContext(@Nullable @Nullable NSManagedObjectContext value)API-Since: 5.0
-
setPersistentStoreCoordinator
public void setPersistentStoreCoordinator(@Nullable @Nullable NSPersistentStoreCoordinator value)coordinator which provides model and handles persistency (multiple contexts can share a coordinator)
-
setPropagatesDeletesAtEndOfEvent
public void setPropagatesDeletesAtEndOfEvent(boolean value)
The default is YES.
-
setQueryGenerationFromTokenError
public boolean setQueryGenerationFromTokenError(@Nullable @Nullable NSQueryGenerationToken generation, @Nullable @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)Set the query generation this context should use. Must be one of the following values: - nil => this context will not use generational querying - the value returned by +[NSQueryGenerationToken currentQueryGenerationToken] => this context will pin itself to the generation of the database when it first loads data - the result of calling -[NSManagedObjectContext queryGenerationToken] on another managed object context => this context will be set to whatever query generation the original context is currently using; 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. API-Since: 10.0
-
setRetainsRegisteredObjects
public void setRetainsRegisteredObjects(boolean value)
The default is NO.
-
setShouldDeleteInaccessibleFaults
public void setShouldDeleteInaccessibleFaults(boolean value)
set the rule to handle inaccessible faults. If YES, then the managed object is marked deleted and all its properties, including scalars, nonnullable, and mandatory properties, will be nil or zero’d out. If NO, the context will throw an exception. Managed objects that are inaccessible because their context is nil due to memory management issues will throw an exception regardless. API-Since: 9.0
-
setStalenessInterval
public void setStalenessInterval(double value)
a negative value is considered infinite. The default is infinite staleness.
-
setUndoManager
public void setUndoManager(@Nullable @Nullable NSUndoManager value)
-
shouldDeleteInaccessibleFaults
public boolean shouldDeleteInaccessibleFaults()
set the rule to handle inaccessible faults. If YES, then the managed object is marked deleted and all its properties, including scalars, nonnullable, and mandatory properties, will be nil or zero’d out. If NO, the context will throw an exception. Managed objects that are inaccessible because their context is nil due to memory management issues will throw an exception regardless. API-Since: 9.0
-
shouldHandleInaccessibleFaultForObjectIDTriggeredByProperty
public boolean shouldHandleInaccessibleFaultForObjectIDTriggeredByProperty(@NotNull @NotNull NSManagedObject fault, @NotNull @NotNull NSManagedObjectID oid, @Nullable @Nullable 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. the fault is inaccessible because the object or its context have been released) this method will not be called if Core Data determines there is an unambiguously correct action to recover. This might happen if a fault was tripped during delete propagation. In that case, the fault will simply be deleted. triggeringProperty may be nil when either all properties are involved, or Core Data is unable to determine the reason for firing the fault. the default implementation logs and then returns the value of -shouldDeleteInaccessibleFaults. API-Since: 9.0
-
stalenessInterval
public double stalenessInterval()
a negative value is considered infinite. The default is infinite staleness.
-
tryLock
@Deprecated public boolean tryLock()
Deprecated.API-Since: 3.0 Deprecated-Since: 8.0 Deprecated-Message: Use a queue style context and -performBlock: instead
-
undo
public void undo()
-
undoManager
@Nullable public @Nullable NSUndoManager undoManager()
-
updatedObjects
@NotNull public @NotNull NSSet<? extends NSManagedObject> updatedObjects()
-
userInfo
@NotNull public @NotNull NSMutableDictionary<?,?> userInfo()
API-Since: 5.0
-
setTransactionAuthor
public void setTransactionAuthor(@Nullable @Nullable java.lang.String value)Set the author for the context, this will be used as an identifier in the Persistent History Transactions (NSPersistentHistoryTransaction) API-Since: 11.0
-
transactionAuthor
@Nullable public @Nullable java.lang.String transactionAuthor()
Set the author for the context, this will be used as an identifier in the Persistent History Transactions (NSPersistentHistoryTransaction) API-Since: 11.0
-
useStoredAccessor
@Deprecated public static boolean useStoredAccessor()
Deprecated.
-
-