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.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 java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)voidassignObjectToPersistentStore(java.lang.Object object, 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(java.lang.String key)static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(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.ClassclassForKeyedUnarchiver()longconcurrencyType()longcountForFetchRequestError(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.StringdebugDescription_static()NSSet<? extends NSManagedObject>deletedObjects()voiddeleteObject(NSManagedObject object)static java.lang.Stringdescription_static()voiddetectConflictsForObject(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(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:NSPersistentStoreResultexecuteRequestError(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.NSManagedObjectexistingObjectWithIDError(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.booleanhasChanges()static longhash_static()NSManagedObjectContextinit()Deprecated.NSManagedObjectContextinitWithCoder(NSCoder coder)NS_DESIGNATED_INITIALIZERNSManagedObjectContextinitWithConcurrencyType(long ct)NSSet<? extends NSManagedObject>insertedObjects()voidinsertObject(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 NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)voidlock()Deprecated.voidmergeChangesFromContextDidSaveNotification(NSNotification notification)Merges the changes specified in notification object received from another context's NSManagedObjectContextDidSaveNotification into the receiver.static voidmergeChangesFromRemoteContextSaveIntoContexts(NSDictionary<?,?> changeNotificationData, NSArray<? extends NSManagedObjectContext> contexts)Similar to mergeChangesFromContextDidSaveNotification, this method handles changes from potentially other processes or serialized state.java.lang.ObjectmergePolicy()default: NSErrorMergePolicyjava.lang.Stringname()custom label for a context.static java.lang.Objectnew_objc()Deprecated.NSManagedObjectobjectRegisteredForID(NSManagedObjectID objectID)returns the object for the specified ID if it is registered in the context already or nil.NSManagedObjectobjectWithID(NSManagedObjectID objectID)returns the object for the specified ID if it is already registered, otherwise it creates a fault corresponding to that objectID.voidobserveValueForKeyPathOfObjectChangeContext(java.lang.String keyPath, java.lang.Object object, NSDictionary<java.lang.String,?> change, org.moe.natj.general.ptr.VoidPtr context)key-value observationbooleanobtainPermanentIDsForObjectsError(NSArray<? extends NSManagedObject> objects, org.moe.natj.general.ptr.Ptr<NSError> error)Converts the object IDs of the specified objects to permanent IDs.NSManagedObjectContextparentContext()voidperformBlock(NSManagedObjectContext.Block_performBlock block)asynchronously performs the block on the context's queue.voidperformBlockAndWait(NSManagedObjectContext.Block_performBlockAndWait block)synchronously performs the block on the context's queue.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.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(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()voidreset()static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)booleanretainsRegisteredObjects()The default is NO.voidrollback()booleansave(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(java.lang.Object value)default: NSErrorMergePolicyvoidsetName(java.lang.String value)custom label for a context.voidsetParentContext(NSManagedObjectContext value)voidsetPersistentStoreCoordinator(NSPersistentStoreCoordinator value)coordinator which provides model and handles persistency (multiple contexts can share a coordinator)voidsetPropagatesDeletesAtEndOfEvent(boolean value)The default is YES.booleansetQueryGenerationFromTokenError(NSQueryGenerationToken generation, 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(java.lang.String value)Set the author for the context, this will be used as an identifier in the Persistent History Transactions (NSPersistentHistoryTransaction)voidsetUndoManager(NSUndoManager value)static voidsetVersion_static(long aVersion)booleanshouldDeleteInaccessibleFaults()set the rule to handle inaccessible faults.booleanshouldHandleInaccessibleFaultForObjectIDTriggeredByProperty(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. 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.doublestalenessInterval()a negative value is considered infinite.static org.moe.natj.objc.Classsuperclass_static()java.lang.StringtransactionAuthor()Set the author for the context, this will be used as an identifier in the Persistent History Transactions (NSPersistentHistoryTransaction)booleantryLock()Deprecated.voidundo()NSUndoManagerundoManager()voidunlock()Deprecated.NSSet<? extends NSManagedObject>updatedObjects()NSMutableDictionary<?,?>userInfo()static longversion_static()-
Methods inherited from class apple.NSObject
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, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static NSManagedObjectContext alloc()
-
allocWithZone
public static java.lang.Object allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
public static 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
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
-
mergeChangesFromRemoteContextSaveIntoContexts
public static void mergeChangesFromRemoteContextSaveIntoContexts(NSDictionary<?,?> changeNotificationData, 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
-
new_objc
@Deprecated public static java.lang.Object new_objc()
Deprecated.
-
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(java.lang.Object 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.
-
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.
-
concurrencyType
public long concurrencyType()
-
countForFetchRequestError
public 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:. If an error occurred during the processing of the request, this method will return NSNotFound.
-
deleteObject
public void deleteObject(NSManagedObject object)
-
deletedObjects
public NSSet<? extends NSManagedObject> deletedObjects()
-
detectConflictsForObject
public 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.
-
encodeWithCoder
public void encodeWithCoder(NSCoder coder)
- Specified by:
encodeWithCoderin interfaceNSCoding
-
executeFetchRequestError
public 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:
-
executeRequestError
public 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. 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.
-
existingObjectWithIDError
public 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. 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.
-
hasChanges
public boolean hasChanges()
-
init
@Deprecated public NSManagedObjectContext init()
Deprecated.
-
initWithCoder
public NSManagedObjectContext initWithCoder(NSCoder coder)
Description copied from interface:NSCodingNS_DESIGNATED_INITIALIZER- Specified by:
initWithCoderin interfaceNSCoding
-
initWithConcurrencyType
public NSManagedObjectContext initWithConcurrencyType(long ct)
-
insertObject
public void insertObject(NSManagedObject object)
-
insertedObjects
public NSSet<? extends NSManagedObject> insertedObjects()
-
mergeChangesFromContextDidSaveNotification
public void mergeChangesFromContextDidSaveNotification(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.
-
mergePolicy
public java.lang.Object mergePolicy()
default: NSErrorMergePolicy
-
name
public java.lang.String name()
custom label for a context. NSPrivateQueueConcurrencyType contexts will set the label on their queue
-
objectRegisteredForID
public NSManagedObject objectRegisteredForID(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
public 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. 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(java.lang.String keyPath, java.lang.Object object, NSDictionary<java.lang.String,?> change, org.moe.natj.general.ptr.VoidPtr context)key-value observation- Overrides:
observeValueForKeyPathOfObjectChangeContextin classNSObject
-
obtainPermanentIDsForObjectsError
public 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. 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.
-
parentContext
public NSManagedObjectContext parentContext()
-
performBlock
public void performBlock(NSManagedObjectContext.Block_performBlock block)
asynchronously performs the block on the context's queue. Encapsulates an autorelease pool and a call to processPendingChanges
-
performBlockAndWait
public void performBlockAndWait(NSManagedObjectContext.Block_performBlockAndWait block)
synchronously performs the block on the context's queue. May safely be called reentrantly.
-
persistentStoreCoordinator
public 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
public 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.
-
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
-
refreshObjectMergeChanges
public 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)
-
registeredObjects
public NSSet<? extends NSManagedObject> registeredObjects()
-
reset
public void reset()
-
retainsRegisteredObjects
public boolean retainsRegisteredObjects()
The default is NO.
-
rollback
public void rollback()
-
save
public boolean save(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.
-
setMergePolicy
public void setMergePolicy(java.lang.Object value)
default: NSErrorMergePolicy
-
setName
public void setName(java.lang.String value)
custom label for a context. NSPrivateQueueConcurrencyType contexts will set the label on their queue
-
setParentContext
public void setParentContext(NSManagedObjectContext value)
-
setPersistentStoreCoordinator
public void setPersistentStoreCoordinator(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(NSQueryGenerationToken generation, 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.
-
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.
-
setStalenessInterval
public void setStalenessInterval(double value)
a negative value is considered infinite. The default is infinite staleness.
-
setUndoManager
public void setUndoManager(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.
-
shouldHandleInaccessibleFaultForObjectIDTriggeredByProperty
public 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. 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.
-
stalenessInterval
public double stalenessInterval()
a negative value is considered infinite. The default is infinite staleness.
-
tryLock
@Deprecated public boolean tryLock()
Deprecated.
-
undo
public void undo()
-
undoManager
public NSUndoManager undoManager()
-
updatedObjects
public NSSet<? extends NSManagedObject> updatedObjects()
-
userInfo
public NSMutableDictionary<?,?> userInfo()
-
setTransactionAuthor
public 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)
-
transactionAuthor
public java.lang.String transactionAuthor()
Set the author for the context, this will be used as an identifier in the Persistent History Transactions (NSPersistentHistoryTransaction)
-
-