CursorBase

public protocol CursorBase : NSObjectProtocol

The code generator generates concrete instances of CursorBase objects that perform the actual work of transferring database values into your Swift objects and extracting them for writing out.

You usually don’t have to deal with this class.

  • The type a particular cursor serves as an adapter for.

    Declaration

    Swift

    associatedtype EntityType : Entity, EntityInspectable
  • Used by Cursor to create new CursorBase adapter instances.

    Declaration

    Swift

    init()
  • Writes the given entity’s value to the given PropertyCollector. returns: The ID of a persisted entity, or 0 to indicate @p entity needs to get assigned an ID.

    Declaration

    Swift

    func collect(fromEntity entity: EntityType, propertyCollector: PropertyCollector, store: Store) -> EntityId
  • Creates a new entity based on data from the given EntityReader. Returns: The new entity.

    Declaration

    Swift

    func createEntity(entityReader: EntityReader, store: Store) -> EntityType
  • For class types, this is used to write the new entity ID back to the entity when they are first put into a box.

    Declaration

    Swift

    func setEntityId(of entity: EntityType, to entityId: EntityId)
  • Used to read the ID of an entity.

    Declaration

    Swift

    func entityId(of entity: EntityType) -> EntityId