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 NSPersistentStores 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 or CoreStoreObject entity class

    Declaration

    Swift

    public let entityClass: O.Type
  • The NSPersistentStore configuration name to associate objects from. May contain a String to pertain to a named configuration, or nil to pertain to the default configuration

    Declaration

    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 or CoreStoreObject 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 created NSManagedObject‘s or CoreStoreObject’s entity type. Set to nil 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 or CoreStoreObject type to be created

    configuration

    the NSPersistentStore configuration name to associate the object to. This parameter is required if multiple configurations contain the created NSManagedObject‘s or CoreStoreObject’s entity type. Set to nil to use the default configuration.

Equatable

Hashable

  • Declaration

    Swift

    public func hash(into hasher: inout Hasher)

CustomDebugStringConvertible

  • Declaration

    Swift

    public var debugDescription: String { get }