Class: NSMigrationManager
Overview
Instances of NSMigrationManager perform a migration of data from one persistent store to another using a given mapping model.
Instance Method Summary (collapse)
-
- associateSourceInstance:withDestinationInstance:forEntityMapping:
Associates a given source instance with an array of destination instances for a given property mapping.
-
- cancelMigrationWithError:
Cancels the migration with a given error.
-
- currentEntityMapping
Returns the entity mapping currently being processed.
-
- destinationContext
Returns the managed object context the receiver uses for writing the destination persistent store.
-
- destinationEntityForEntityMapping:
Returns the entity description for the destination entity of a given entity mapping.
-
- destinationInstancesForEntityMappingNamed:sourceInstances:
Returns the managed object instances created in the destination store for a named entity mapping for a given array of source instances.
-
- destinationModel
Returns the destination model for the receiver.
-
- initWithSourceModel:destinationModel:
Initializes a migration manager instance with given source and destination models.
-
- mappingModel
Returns the mapping model for the receiver.
-
- migrateStoreFromURL:type:options:withMappingModel:toDestinationURL:destinationType:destinationOptions:error:
Migrates of the store at a given source URL to the store at a given destination URL, performing all of the mappings specified in a given mapping model.
-
- migrationProgress
Returns a number from 0 to 1 that indicates the proportion of completeness of the migration.
-
- reset
Resets the association tables for the migration.
-
- setUserInfo:
Sets the user info for the receiver.
-
- setUsesStoreSpecificMigrationManager:
Sets whether the receiver tries to use a store specific migration manager to perform the migration.
-
- sourceContext
Returns the managed object context the receiver uses for reading the source persistent store.
-
- sourceEntityForEntityMapping:
Returns the entity description for the source entity of a given entity mapping.
-
- sourceInstancesForEntityMappingNamed:destinationInstances:
Returns the managed object instances in the source store used to create a given destination instance for a given property mapping.
-
- sourceModel
Returns the source model for the receiver.
-
- userInfo
Returns the user info for the receiver.
-
- usesStoreSpecificMigrationManager
Returns a Boolean value that indicates whether the receiver tries to use a store specific migration manager to perform the migration.
Methods inherited from NSObject
#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version
Constructor Details
This class inherits a constructor from NSObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class NSObject
Instance Method Details
- (Object) associateSourceInstance(sourceInstance, withDestinationInstance:destinationInstance, forEntityMapping:entityMapping)
Associates a given source instance with an array of destination instances for a given property mapping. Data migration is performed as a three-stage process (first create the data, then relate the data, then validate the data). You use this method to associate data between the source and destination stores, in order to allow for relationship creation or fix-up after the creation stage.This method is called in the default implementation of NSEntityMigrationPolicy’s createDestinationInstancesForSourceInstance:entityMapping:manager:error: method.
- (Object) cancelMigrationWithError(error)
Cancels the migration with a given error. You can invoke this method from anywhere in the migration process to abort the migration. Calling this method causes migrateStoreFromURL:type:options:withMappingModel:toDestinationURL:destinationType:destinationOptions:error: to abort the migration and return error—you should provide an appropriate error to indicate the reason for the cancellation.
- (NSEntityMapping) currentEntityMapping
Returns the entity mapping currently being processed. Each entity is processed a total of three times (instance creation, relationship creation, validation).
- (NSManagedObjectContext) destinationContext
Returns the managed object context the receiver uses for writing the destination persistent store. This context is created on demand as part of the initialization of the Core Data stacks used for migration.
- (NSEntityDescription) destinationEntityForEntityMapping(mEntity)
Returns the entity description for the destination entity of a given entity mapping. Entity mappings do not store the actual description objects, but rather the name and version information of the entity.
- (Array) destinationInstancesForEntityMappingNamed(mappingName, sourceInstances:sourceInstances)
Returns the managed object instances created in the destination store for a named entity mapping for a given array of source instances.
- (NSManagedObjectModel) destinationModel
Returns the destination model for the receiver.
- (Object) initWithSourceModel(sourceModel, destinationModel:destinationModel)
Initializes a migration manager instance with given source and destination models. You specify the mapping model in the migration method, migrateStoreFromURL:type:options:withMappingModel:toDestinationURL:destinationType:destinationOptions:error:.
- (NSMappingModel) mappingModel
Returns the mapping model for the receiver.
- (Boolean) migrateStoreFromURL(sourceURL, type:sStoreType, options:sOptions, withMappingModel:mappings, toDestinationURL:dURL, destinationType:dStoreType, destinationOptions:dOptions, error:error)
Migrates of the store at a given source URL to the store at a given destination URL, performing all of the mappings specified in a given mapping model. This method performs compatibility checks on the source and destination models and the mapping model.
- (Float) migrationProgress
Returns a number from 0 to 1 that indicates the proportion of completeness of the migration.
- (Object) reset
Resets the association tables for the migration.
- (Object) setUserInfo(dict)
Sets the user info for the receiver. You can use the user info dictionary to aid the customization of your migration process.
- (Object) setUsesStoreSpecificMigrationManager(flag)
Sets whether the receiver tries to use a store specific migration manager to perform the migration. A store-specific migration manager class is not guaranteed to perform any of the migration manager delegate callbacks or update values for the observable properties.The default value is YES.
- (NSManagedObjectContext) sourceContext
Returns the managed object context the receiver uses for reading the source persistent store. This context is created on demand as part of the initialization of the Core Data stacks used for migration.
- (NSEntityDescription) sourceEntityForEntityMapping(mEntity)
Returns the entity description for the source entity of a given entity mapping. Entity mappings do not store the actual description objects, but rather the name and version information of the entity.
- (Array) sourceInstancesForEntityMappingNamed(mappingName, destinationInstances:destinationInstances)
Returns the managed object instances in the source store used to create a given destination instance for a given property mapping.
- (NSManagedObjectModel) sourceModel
Returns the source model for the receiver.
- (Hash) userInfo
Returns the user info for the receiver.
- (Boolean) usesStoreSpecificMigrationManager
Returns a Boolean value that indicates whether the receiver tries to use a store specific migration manager to perform the migration. For more discussion, see setUsesStoreSpecificMigrationManager:.