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 one or more of keyProperties have a Property.hasKeyPath value of true.

    Declaration

    Swift

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

    Declaration

    Swift

    final public var isMedia: Bool
  • List of key properties for this type.

    Declaration

    Swift

    final public var keyProperties: PropertyList
  • 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
  • Names of columns (or properties) that are permitted for database-level full-text searching. If not specified, will be lazily initialized as a list of all string-typed properties.

    Declaration

    Swift

    final public var searchColumns: StringList
  • The number of entity sets using this entity type.

    Declaration

    Swift

    final public var countSets: Int
  • The number of local draft entity sets using this entity type.

    Declaration

    Swift

    final public var draftSets: 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 }
  • Declaration

    Swift

    open func inheritsFrom(other: EntityType) -> Bool

    Parameters

    other

    Other entity type.

    Return Value

    true if this entity type inherits from other.

  • 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.