Into
public struct Into<O> : Hashable where O : DynamicObject
extension Into: CustomDebugStringConvertible, CoreStoreDebugStringConvertible
An Into
clause contains the destination entity and destination persistent store for a create(...)
method. A common usage is to just indicate the entity:
let person = transaction.create(Into<MyPersonEntity>())
For cases where multiple NSPersistentStore
s contain the same entity, the destination configuration’s name needs to be specified as well:
let person = transaction.create(Into<MyPersonEntity>("Configuration1"))
-
The associated
NSManagedObject
orCoreStoreObject
entity classDeclaration
Swift
public let entityClass: O.Type
-
The
NSPersistentStore
configuration name to associate objects from. May contain aString
to pertain to a named configuration, ornil
to pertain to the default configurationDeclaration
Swift
public let configuration: ModelConfiguration
-
Initializes an
Into
clause.let person = transaction.create(Into<MyPersonEntity>())
Declaration
Swift
public init()
-
Initializes an
Into
clause with the specified entity type. This is useful for querying a subclass while binding the generic type with a base class.let person = transaction.create(Into<MyPersonEntity>(MyEmployeeEntity.self))
Declaration
Swift
public init(_ entity: O.Type)
Parameters
entity
the
NSManagedObject
orCoreStoreObject
type to be created -
Initializes an
Into
clause with the specified configuration.let person = transaction.create(Into<MyPersonEntity>("Configuration1"))
Declaration
Swift
public init(_ configuration: ModelConfiguration)
Parameters
configuration
the
NSPersistentStore
configuration name to associate the object to. This parameter is required if multiple configurations contain the createdNSManagedObject
‘s orCoreStoreObject
’s entity type. Set tonil
to use the default configuration. -
Initializes an
Into
clause with the specified entity type and configuration. This is useful for querying a subclass while binding the generic type with a base class.let person = transaction.create(Into<MyPersonEntity>(MyEmployeeEntity.self, "Configuration1"))
Declaration
Swift
public init(_ entity: O.Type, _ configuration: ModelConfiguration)
Parameters
entity
the
NSManagedObject
orCoreStoreObject
type to be createdconfiguration
the
NSPersistentStore
configuration name to associate the object to. This parameter is required if multiple configurations contain the createdNSManagedObject
‘s orCoreStoreObject
’s entity type. Set tonil
to use the default configuration.
-
Declaration
Swift
public static func == <U, V>(lhs: Into<U>, rhs: Into<V>) -> Bool where U : DynamicObject, V : DynamicObject
-
Declaration
Swift
public func hash(into hasher: inout Hasher)
-
Declaration
Swift
public var debugDescription: String { get }