Class NSMigrationManager

  • All Implemented Interfaces:
    NSObject

    public class NSMigrationManager
    extends NSObject
    • Constructor Detail

      • NSMigrationManager

        protected NSMigrationManager​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • 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()
      • 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)
      • 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()
      • associateSourceInstanceWithDestinationInstanceForEntityMapping

        public void associateSourceInstanceWithDestinationInstanceForEntityMapping​(NSManagedObject sourceInstance,
                                                                                   NSManagedObject destinationInstance,
                                                                                   NSEntityMapping entityMapping)
        Associates the source instance with the specified destination instance for the given entity mapping. Since the migration is performed as a three-step process (first create the data, then relate the data, then validate the data) it is necessary to be able to associate data between the source and destination stores, in order to allow for relationship creation/fixup after the creation pass. This method is called in the default implementation of NSEntityMigrationPolicy's createDestinationInstancesForSourceInstance:entityMapping:manager:error: method.
      • cancelMigrationWithError

        public void cancelMigrationWithError​(NSError error)
        Cancels the migration with the specified error. Calling this method causes migrateStoreFromURL:type:options:withMappingModel:toDestinationURL:destinationType:destinationOptions:error: to abort the migration and return the specified error.
      • currentEntityMapping

        public NSEntityMapping currentEntityMapping()
        Observable property that can be used to determine progress of the migration process. Returns the current entity mapping being processed. Each entity is processed a total of three times (instance creation, relationship creation, validation)
      • destinationInstancesForEntityMappingNamedSourceInstances

        public NSArray<? extends NSManagedObject> destinationInstancesForEntityMappingNamedSourceInstances​(java.lang.String mappingName,
                                                                                                           NSArray<? extends NSManagedObject> sourceInstances)
        Returns the managed object instances created in the destination store for the given entity mapping for the specified source instances.
      • initWithSourceModelDestinationModel

        public NSMigrationManager initWithSourceModelDestinationModel​(NSManagedObjectModel sourceModel,
                                                                      NSManagedObjectModel destinationModel)
        Creates a migration manager instance with the corresponding source and destination models. (All validation of the arguments is performed during migrateStoreFromURL:toURL:) As with the NSPersistentStoreCoordinator, once models are added to the migration manager they are immutable and cannot be altered.
      • mappingModel

        public NSMappingModel mappingModel()
        Accessors for the mapping model, source model, and destination model
      • migrateStoreFromURLTypeOptionsWithMappingModelToDestinationURLDestinationTypeDestinationOptionsError

        public boolean migrateStoreFromURLTypeOptionsWithMappingModelToDestinationURLDestinationTypeDestinationOptionsError​(NSURL sourceURL,
                                                                                                                            java.lang.String sStoreType,
                                                                                                                            NSDictionary<?,​?> sOptions,
                                                                                                                            NSMappingModel mappings,
                                                                                                                            NSURL dURL,
                                                                                                                            java.lang.String dStoreType,
                                                                                                                            NSDictionary<?,​?> dOptions,
                                                                                                                            org.moe.natj.general.ptr.Ptr<NSError> error)
        Migrates of the store at the specified source URL to the store at the destination URL, performing all of the mappings in the mapping model. A store must exist at the source URL; if a store does not exist at the destination URL, one will be created (otherwise the migration will append to the existing store.) Invoking this method will perform compatibility checks on the source and destination models (and the mapping model.) If an error occurs during the validation or migration, this method will return NO.
      • migrationProgress

        public float migrationProgress()
        Observable property that can be used to determine progress of the migration process. Returns the percentage complete of the migration process. The progress value is a number from 0 to 1 indicating percent complete.
      • reset

        public void reset()
        Resets the association tables for the migration. (Note this does NOT reset the source or destination contexts).
      • setUserInfo

        public void setUserInfo​(NSDictionary<?,​?> value)
        Returns/sets the user info for the migration manager
      • setUsesStoreSpecificMigrationManager

        public void setUsesStoreSpecificMigrationManager​(boolean value)
        Tries to use a store specific migration manager to perform the store migration, note that 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. Defaults to YES
      • sourceContext

        public NSManagedObjectContext sourceContext()
        Accessors for the managed object contexts used for reading the source and destination stores. These contexts are created lazily, as part of the initialization of two Core Data stacks (one for reading, the other for writing data.)
      • sourceEntityForEntityMapping

        public NSEntityDescription sourceEntityForEntityMapping​(NSEntityMapping mEntity)
        Returns the NSEntityDescription for the source and destination entities, respectively, of the entity mapping. (Entity mappings do not store the actual description objects, but rather the name and version information of the entity.)
      • sourceInstancesForEntityMappingNamedDestinationInstances

        public NSArray<? extends NSManagedObject> sourceInstancesForEntityMappingNamedDestinationInstances​(java.lang.String mappingName,
                                                                                                           NSArray<? extends NSManagedObject> destinationInstances)
        Returns the managed object instances in the source store used to create the specified destination instances for the given entity mapping.
      • userInfo

        public NSDictionary<?,​?> userInfo()
        Returns/sets the user info for the migration manager
      • usesStoreSpecificMigrationManager

        public boolean usesStoreSpecificMigrationManager()
        Tries to use a store specific migration manager to perform the store migration, note that 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. Defaults to YES