All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bugvm.apple.coredata.NSMigrationManager Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (C) 2013-2015 RoboVM AB
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.bugvm.apple.coredata;

/**/
import java.io.*;
import java.nio.*;
import java.util.*;
import com.bugvm.objc.*;
import com.bugvm.objc.annotation.*;
import com.bugvm.objc.block.*;
import com.bugvm.rt.*;
import com.bugvm.rt.annotation.*;
import com.bugvm.rt.bro.*;
import com.bugvm.rt.bro.annotation.*;
import com.bugvm.rt.bro.ptr.*;
import com.bugvm.apple.foundation.*;
/**/

/**/
/**
 * @since Available in iOS 3.0 and later.
 */
/**/
/**/@Library("CoreData") @NativeClass/**/
/**/public/**/ class /**/NSMigrationManager/**/ 
    extends /**/NSObject/**/ 
    /**//**/ {

    /**/public static class NSMigrationManagerPtr extends Ptr {}/**/
    /**/static { ObjCRuntime.bind(NSMigrationManager.class); }/**/
    /**//**/
    /**/
    public NSMigrationManager() {}
    protected NSMigrationManager(SkipInit skipInit) { super(skipInit); }
    public NSMigrationManager(NSManagedObjectModel sourceModel, NSManagedObjectModel destinationModel) { super((SkipInit) null); initObject(init(sourceModel, destinationModel)); }
    /**/
    /**/
    /**
     * @since Available in iOS 5.0 and later.
     */
    @Property(selector = "usesStoreSpecificMigrationManager")
    public native boolean usesStoreSpecificMigrationManager();
    /**
     * @since Available in iOS 5.0 and later.
     */
    @Property(selector = "setUsesStoreSpecificMigrationManager:")
    public native void setUsesStoreSpecificMigrationManager(boolean v);
    @Property(selector = "mappingModel")
    public native NSMappingModel getMappingModel();
    @Property(selector = "sourceModel")
    public native NSManagedObjectModel getSourceModel();
    @Property(selector = "destinationModel")
    public native NSManagedObjectModel getDestinationModel();
    @Property(selector = "sourceContext")
    public native NSManagedObjectContext getSourceContext();
    @Property(selector = "destinationContext")
    public native NSManagedObjectContext getDestinationContext();
    @Property(selector = "currentEntityMapping")
    public native NSEntityMapping getCurrentEntityMapping();
    @Property(selector = "migrationProgress")
    public native float getMigrationProgress();
    @Property(selector = "userInfo")
    public native NSDictionary getUserInfo();
    @Property(selector = "setUserInfo:")
    public native void setUserInfo(NSDictionary v);
    /**/
    /**//**/
    /**
     * 
     * @param sourceURL
     * @param sStoreType
     * @param sOptions
     * @param mappings
     * @param dURL
     * @param dStoreType
     * @param dOptions
     * @return
     * @throws NSErrorException
     */
    public boolean migrateStore(NSURL sourceURL, NSPersistentStoreType sStoreType, NSPersistentStoreOptions sOptions, NSMappingModel mappings, NSURL dURL, NSPersistentStoreType dStoreType, NSPersistentStoreOptions dOptions) throws NSErrorException {
        return migrateStore(sourceURL, sStoreType.value().toString(), sOptions, mappings, dURL, dStoreType.value().toString(), dOptions);
    }
    /**/
    @Method(selector = "initWithSourceModel:destinationModel:")
    protected native @Pointer long init(NSManagedObjectModel sourceModel, NSManagedObjectModel destinationModel);
    public boolean migrateStore(NSURL sourceURL, String sStoreType, NSPersistentStoreOptions sOptions, NSMappingModel mappings, NSURL dURL, String dStoreType, NSPersistentStoreOptions dOptions) throws NSErrorException {
       NSError.NSErrorPtr ptr = new NSError.NSErrorPtr();
       boolean result = migrateStore(sourceURL, sStoreType, sOptions, mappings, dURL, dStoreType, dOptions, ptr);
       if (ptr.get() != null) { throw new NSErrorException(ptr.get()); }
       return result;
    }
    @Method(selector = "migrateStoreFromURL:type:options:withMappingModel:toDestinationURL:destinationType:destinationOptions:error:")
    private native boolean migrateStore(NSURL sourceURL, String sStoreType, NSPersistentStoreOptions sOptions, NSMappingModel mappings, NSURL dURL, String dStoreType, NSPersistentStoreOptions dOptions, NSError.NSErrorPtr error);
    @Method(selector = "reset")
    public native void reset();
    @Method(selector = "sourceEntityForEntityMapping:")
    public native NSEntityDescription getSourceEntity(NSEntityMapping mEntity);
    @Method(selector = "destinationEntityForEntityMapping:")
    public native NSEntityDescription getDestinationEntity(NSEntityMapping mEntity);
    @Method(selector = "associateSourceInstance:withDestinationInstance:forEntityMapping:")
    public native void associateInstances(NSManagedObject sourceInstance, NSManagedObject destinationInstance, NSEntityMapping entityMapping);
    @Method(selector = "destinationInstancesForEntityMappingNamed:sourceInstances:")
    public native NSArray getDestinationInstances(String mappingName, NSArray sourceInstances);
    @Method(selector = "sourceInstancesForEntityMappingNamed:destinationInstances:")
    public native NSArray getSourceInstances(String mappingName, NSArray destinationInstances);
    @Method(selector = "cancelMigrationWithError:")
    public native void cancelMigration(NSError error);
    /**/
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy