Package apple.coredata
Class NSManagedObjectModel
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.coredata.NSManagedObjectModel
-
- All Implemented Interfaces:
NSCoding,NSCopying,NSFastEnumeration,NSObject
public class NSManagedObjectModel extends NSObject implements NSCoding, NSCopying, NSFastEnumeration
Models describe object graphs to be managed. Models (and their entities/properties/fetch request templates) are editable until they are used by a persistent store coordinator, allowing developers to create/modify them dynamically. However, once a model is being used, it MUST NOT be changed. When the persistent store coordinator first fetches data using a model, it will become uneditable. Any attempt to mutate a model or any of its subobjects after that point will cause an exception to be thrown. If you need to modify a model that is in use, create a copy, modify the copy, and then discard the objects with the old model.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNSManagedObjectModel(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanaccessInstanceVariablesDirectly()static NSManagedObjectModelalloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)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()NSArray<java.lang.String>configurations()returns all available configuration namesjava.lang.ObjectcopyWithZone(org.moe.natj.general.ptr.VoidPtr zone)longcountByEnumeratingWithStateObjectsCount(org.moe.natj.general.ptr.VoidPtr state, org.moe.natj.general.ptr.Ptr<org.moe.natj.objc.ObjCObject> buffer, long len)static java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()voidencodeWithCoder(NSCoder coder)NSArray<? extends NSEntityDescription>entities()NSDictionary<java.lang.String,? extends NSEntityDescription>entitiesByName()NSArray<? extends NSEntityDescription>entitiesForConfiguration(java.lang.String configuration)NSDictionary<java.lang.String,? extends NSData>entityVersionHashesByName()Returns a dictionary of the version hashes for the entities in the model, keyed by entity name.NSFetchRequest<?>fetchRequestFromTemplateWithNameSubstitutionVariables(java.lang.String name, NSDictionary<java.lang.String,?> variables)returns a copy of the fetch request template with the variable bindings substituted - this is the usual way to bind an "abstractly" defined fetch request template to a concrete fetchNSFetchRequest<?>fetchRequestTemplateForName(java.lang.String name)NSDictionary<java.lang.String,? extends NSFetchRequest<?>>fetchRequestTemplatesByName()Returns the dictionary of fetch request templates, keyed by name, for the model.static longhash_static()NSManagedObjectModelinit()NSManagedObjectModelinitWithCoder(NSCoder coder)NS_DESIGNATED_INITIALIZERNSManagedObjectModelinitWithContentsOfURL(NSURL url)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)booleanisConfigurationCompatibleWithStoreMetadata(java.lang.String configuration, NSDictionary<java.lang.String,?> metadata)Compares the version information in the store metadata with the entity version of a given configuration.static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)NSDictionary<java.lang.String,java.lang.String>localizationDictionary()NSDictionary containing localized string values for entities, properties, and error strings related to this model.static NSManagedObjectModelmergedModelFromBundles(NSArray<? extends NSBundle> bundles)looks up all models in the specified bundles and merges them; if nil is specified as argument, uses the main bundlestatic NSManagedObjectModelmergedModelFromBundlesForStoreMetadata(NSArray<? extends NSBundle> bundles, NSDictionary<java.lang.String,?> metadata)Returns the managed object model used to create the store for the specified metadata.static NSManagedObjectModelmodelByMergingModels(NSArray<? extends NSManagedObjectModel> models)combines multiple models (typically from different frameworks) into onestatic NSManagedObjectModelmodelByMergingModelsForStoreMetadata(NSArray<? extends NSManagedObjectModel> models, NSDictionary<java.lang.String,?> metadata)Returns a merged model from the specified array for the version information in the provided metadata.static java.lang.Objectnew_objc()static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)voidsetEntities(NSArray<? extends NSEntityDescription> value)voidsetEntitiesForConfiguration(NSArray<? extends NSEntityDescription> entities, java.lang.String configuration)voidsetFetchRequestTemplateForName(NSFetchRequest<?> fetchRequestTemplate, java.lang.String name)fetch request templates allow to pre-define queries and their parameters in the model (with the tool) - typically they contain variables that need to be substituted at runtime.voidsetLocalizationDictionary(NSDictionary<java.lang.String,java.lang.String> value)NSDictionary containing localized string values for entities, properties, and error strings related to this model.static voidsetVersion_static(long aVersion)voidsetVersionIdentifiers(NSSet<?> value)Returns the collection of developer-defined version identifiers for the model.static org.moe.natj.objc.Classsuperclass_static()static longversion_static()NSSet<?>versionIdentifiers()Returns the collection of developer-defined version identifiers for the model.-
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, observeValueForKeyPathOfObjectChangeContext, 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 NSManagedObjectModel 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)
-
mergedModelFromBundles
public static NSManagedObjectModel mergedModelFromBundles(NSArray<? extends NSBundle> bundles)
looks up all models in the specified bundles and merges them; if nil is specified as argument, uses the main bundle
-
mergedModelFromBundlesForStoreMetadata
public static NSManagedObjectModel mergedModelFromBundlesForStoreMetadata(NSArray<? extends NSBundle> bundles, NSDictionary<java.lang.String,?> metadata)
Returns the managed object model used to create the store for the specified metadata. This method is a companion to the mergedModelFromBundles: method; in this case, the framework uses the version information stored in the metadata for a store to locate the models/entities used to create the store in the available bundles, and return the model. If the model for the store cannot be found, this method will return nil.
-
modelByMergingModels
public static NSManagedObjectModel modelByMergingModels(NSArray<? extends NSManagedObjectModel> models)
combines multiple models (typically from different frameworks) into one
-
modelByMergingModelsForStoreMetadata
public static NSManagedObjectModel modelByMergingModelsForStoreMetadata(NSArray<? extends NSManagedObjectModel> models, NSDictionary<java.lang.String,?> metadata)
Returns a merged model from the specified array for the version information in the provided metadata. (This is the companion method to mergedModelFromBundles:forStoreMetadata:) If a model cannot be created to match the version information in the specified metadata, this method will return nil.
-
new_objc
public static java.lang.Object new_objc()
-
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()
-
configurations
public NSArray<java.lang.String> configurations()
returns all available configuration names
-
copyWithZone
public java.lang.Object copyWithZone(org.moe.natj.general.ptr.VoidPtr zone)
- Specified by:
copyWithZonein interfaceNSCopying
-
countByEnumeratingWithStateObjectsCount
public long countByEnumeratingWithStateObjectsCount(org.moe.natj.general.ptr.VoidPtr state, org.moe.natj.general.ptr.Ptr<org.moe.natj.objc.ObjCObject> buffer, long len)- Specified by:
countByEnumeratingWithStateObjectsCountin interfaceNSFastEnumeration
-
encodeWithCoder
public void encodeWithCoder(NSCoder coder)
- Specified by:
encodeWithCoderin interfaceNSCoding
-
entities
public NSArray<? extends NSEntityDescription> entities()
-
entitiesByName
public NSDictionary<java.lang.String,? extends NSEntityDescription> entitiesByName()
-
entitiesForConfiguration
public NSArray<? extends NSEntityDescription> entitiesForConfiguration(java.lang.String configuration)
-
entityVersionHashesByName
public NSDictionary<java.lang.String,? extends NSData> entityVersionHashesByName()
Returns a dictionary of the version hashes for the entities in the model, keyed by entity name. (The dictionary of version hash information is used by Core Data to determine schema compatibility.)
-
fetchRequestFromTemplateWithNameSubstitutionVariables
public NSFetchRequest<?> fetchRequestFromTemplateWithNameSubstitutionVariables(java.lang.String name, NSDictionary<java.lang.String,?> variables)
returns a copy of the fetch request template with the variable bindings substituted - this is the usual way to bind an "abstractly" defined fetch request template to a concrete fetch
-
fetchRequestTemplateForName
public NSFetchRequest<?> fetchRequestTemplateForName(java.lang.String name)
-
fetchRequestTemplatesByName
public NSDictionary<java.lang.String,? extends NSFetchRequest<?>> fetchRequestTemplatesByName()
Returns the dictionary of fetch request templates, keyed by name, for the model. If the template contains a predicate with substitution variables, you should instead use fetchRequestFromTemplateWithName:substitutionVariables: to create a new fetch request.
-
init
public NSManagedObjectModel init()
-
initWithCoder
public NSManagedObjectModel initWithCoder(NSCoder coder)
Description copied from interface:NSCodingNS_DESIGNATED_INITIALIZER- Specified by:
initWithCoderin interfaceNSCoding
-
initWithContentsOfURL
public NSManagedObjectModel initWithContentsOfURL(NSURL url)
-
isConfigurationCompatibleWithStoreMetadata
public boolean isConfigurationCompatibleWithStoreMetadata(java.lang.String configuration, NSDictionary<java.lang.String,?> metadata)Compares the version information in the store metadata with the entity version of a given configuration. Returns NO if there are differences between the version information. (For information on specific differences, developers should utilize the entityVersionHashesByName method, and perform a comparison.)
-
localizationDictionary
public NSDictionary<java.lang.String,java.lang.String> localizationDictionary()
NSDictionary containing localized string values for entities, properties, and error strings related to this model. The key and value pattern follows: key = "Entity/NonLocalizedEntityName" value = "LocalizedEntityName" // for properties of the same non-localized name in differenct entities, which should have different localized names key = "Property/NonLocalizedPropertyName/Entity/EntityName" value = "LocalizedPropertyName" key = "Property/NonLocalizedPropertyName" value = "LocalizedPropertyName" key = "ErrorString/NonLocalizedErrorString" value = "LocalizedErrorString"
-
setEntities
public void setEntities(NSArray<? extends NSEntityDescription> value)
-
setEntitiesForConfiguration
public void setEntitiesForConfiguration(NSArray<? extends NSEntityDescription> entities, java.lang.String configuration)
-
setFetchRequestTemplateForName
public void setFetchRequestTemplateForName(NSFetchRequest<?> fetchRequestTemplate, java.lang.String name)
fetch request templates allow to pre-define queries and their parameters in the model (with the tool) - typically they contain variables that need to be substituted at runtime.
-
setLocalizationDictionary
public void setLocalizationDictionary(NSDictionary<java.lang.String,java.lang.String> value)
NSDictionary containing localized string values for entities, properties, and error strings related to this model. The key and value pattern follows: key = "Entity/NonLocalizedEntityName" value = "LocalizedEntityName" // for properties of the same non-localized name in differenct entities, which should have different localized names key = "Property/NonLocalizedPropertyName/Entity/EntityName" value = "LocalizedPropertyName" key = "Property/NonLocalizedPropertyName" value = "LocalizedPropertyName" key = "ErrorString/NonLocalizedErrorString" value = "LocalizedErrorString"
-
setVersionIdentifiers
public void setVersionIdentifiers(NSSet<?> value)
Returns the collection of developer-defined version identifiers for the model. For models created in Xcode, this value is set by the developer in the model inspector. Merged models return the combined collection of identifiers. This value is meant to be used as a debugging hint to help developers determine the models that were combined to create a merged model. The framework does not give models a default identifier, nor does it depend this value at runtime.
-
versionIdentifiers
public NSSet<?> versionIdentifiers()
Returns the collection of developer-defined version identifiers for the model. For models created in Xcode, this value is set by the developer in the model inspector. Merged models return the combined collection of identifiers. This value is meant to be used as a debugging hint to help developers determine the models that were combined to create a merged model. The framework does not give models a default identifier, nor does it depend this value at runtime.
-
-