EntityType

open class EntityType : StructureType

Encapsulates the metadata of an OData entity type.

  • Represents an undefined entity type.

    Declaration

    Swift

    public static let undefined: EntityType
  • The abstract base type Edm.EntityType.

    Declaration

    Swift

    public static let abstractBase: EntityType
  • If hasSubtypes is true, then the list of subtypes. Otherwise nil.

    Declaration

    Swift

    final public var subtypes: EntityTypeList?
  • true if this entity type is a media resource (has stream content).

    Declaration

    Swift

    final public var isMedia: Bool
  • Map from property paths (e.g. “Name”, “Address/City”) to SQL column names. By default, this property contains an immutable map. Before setting the contents of this map, please replace the map with a new StringMap.

    Declaration

    Swift

    final public var pathColumns: StringMap
  • The number of entity sets using this entity type.

    Declaration

    Swift

    final public var countSets: Int
  • Default initializer.

    Declaration

    Swift

    override public init()
  • DataType.ENTITY_VALUE

    Declaration

    Swift

    override open var code: Int { get }
  • true if this entity type is a parent of one or more derived entity types.

    Declaration

    Swift

    override open var hasSubtypes: Bool { get }
  • true if this entity type is a subtype of a parent entity type.

    Declaration

    Swift

    override open var hasSupertype: Bool { get }
  • List of key properties for this type.

    Declaration

    Swift

    public final var keyProperties: PropertyList { get set }
  • Lookup a required key property by name.

    See also

    keyProperties.

    Declaration

    Swift

    open func keyProperty(name: String) -> Property

    Parameters

    name

    Name of the property.

    Return Value

    The property metadata.

  • Pseudo-property for media content (media entities only).

    See also

    isMedia.

    Declaration

    Swift

    public final var mediaProperty: StreamProperty { get set }
  • Set the objectFactory for this entity type.

    Declaration

    Swift

    open func registerFactory(_ factory: ObjectFactory)

    Parameters

    factory

    Custom factory to produce EntityValue instances of this type.

  • If hasSupertype is true, then the parent entity type. Otherwise nil.

    Declaration

    Swift

    open var supertype: EntityType? { get set }
  • Declaration

    Swift

    override open func toString() -> String

    Return Value

    The name of this data type.

  • Set the objectFactory for this entity type.

    Declaration

    Swift

    open func withFactory(_ factory: ObjectFactory) -> EntityType

    Parameters

    factory

    Custom factory to produce EntityValue instances of this type.

    Return Value

    This entity type.