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
CustomSchemaMappingProviderDeclaration
Swift
public required init(from sourceVersion: ModelVersion, to destinationVersion: ModelVersion, entityMappings: Set<CustomMapping> = [])Parameters
sourceVersionthe source model version for the mapping
destinationVersionthe destination model version for the mapping
entityMappingsa list of
CustomMappings. Mappings of entities with noCustomMappingprovided 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 moreCustomMappingprovided 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 moreTransformerclosure. 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 moreTransformerclosure. 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)
View on GitHub
CustomSchemaMappingProvider Class Reference