CustomSchemaMappingProvider
public class CustomSchemaMappingProvider : Hashable, SchemaMappingProvider
A SchemaMappingProvider
that accepts custom mappings for some entities. Mappings of entities with no CustomMapping
provided will be automatically calculated if possible.
-
The source model version for the mapping.
Declaration
Swift
public let sourceVersion: ModelVersion
-
The destination model version for the mapping.
Declaration
Swift
public let destinationVersion: ModelVersion
-
Creates a
CustomSchemaMappingProvider
Declaration
Swift
public required init(from sourceVersion: ModelVersion, to destinationVersion: ModelVersion, entityMappings: Set<CustomMapping> = [])
Parameters
sourceVersion
the source model version for the mapping
destinationVersion
the destination model version for the mapping
entityMappings
a list of
CustomMapping
s. Mappings of entities with noCustomMapping
provided will be automatically calculated if possible. Any conflicts or ambiguity will raise an assertion.
-
Provides the type of mapping for an entity. Mappings of entities with no
See moreCustomMapping
provided will be automatically calculated if possible. Any conflicts or ambiguity will raise an assertion.Declaration
Swift
public enum CustomMapping : Hashable
-
The read-only proxy object used for the source object in a mapping’s
See moreTransformer
closure. Properties can be accessed either by keyPath string or byNSAttributeDescription
.Declaration
Swift
public final class UnsafeSourceObject
-
The read-write proxy object used for the destination object that can be created in a mapping’s
See moreTransformer
closure. Properties can be accessed and mutated either through keyPath string or byNSAttributeDescription
.Declaration
Swift
public final class UnsafeDestinationObject
-
Declaration
Swift
public static func == (lhs: CustomSchemaMappingProvider, rhs: CustomSchemaMappingProvider) -> Bool
-
Declaration
Swift
public func hash(into hasher: inout Hasher)
-
Declaration
Swift
public func cs_createMappingModel(from sourceSchema: DynamicSchema, to destinationSchema: DynamicSchema, storage: LocalStorage) throws -> (mappingModel: NSMappingModel, migrationType: MigrationType)