EntitySet
open class EntitySet : ObjectBase, BindingPath
Encapsulates the metadata of an OData entity set.
Also used for OData isSingleton
entities.
See also
DataService.createEntity
, DataService.updateEntity
, DataService.deleteEntity
, DataService.getEntity
, DataService.getEntityList
.
-
Special value for
table
to indicate that this entity set should not be stored in the database.Declaration
Swift
public static let noTable: String
-
Table type for column-based storage.
Declaration
Swift
public static let columnTable: String
-
Table type for row-based storage.
Declaration
Swift
public static let rowTable: String
-
Can this model element be removed by
DataService.refreshMetadata
. Defaults tofalse
. Set this totrue
to indicate that the application is coded to be able able to function correctly without this model element.See also
isRemoved
.Declaration
Swift
final public var canBeRemoved: Bool
-
Has this model element been removed by a successful call to
DataService.refreshMetadata
? If `isRemoved == true, that implies that the old metadata (before refreshMetadata was called) did include this model element, and that the new metadata (after refreshMetadata was called) does not include this model element.See also
canBeRemoved
.Declaration
Swift
final public var isRemoved: Bool
-
The
undefined
value for EntitySet.Declaration
Swift
public static let undefined: EntitySet
-
The local name of this set within its owning
EntityContainer
, e.g. “MyEntitySet”.Declaration
Swift
final public var localName: String
-
The name of this set qualified by its owning
EntityContainer
name, e.g. “MyContainer.MyEntitySet”. The Entity container prefix is omitted for the “default” entity container in the outermost schema.Declaration
Swift
final public var qualifiedName: String
-
The name of this set qualified by its owning
DataSchema
andEntityContainer
names, e.g. “MySchema.MyContainer/MyEntitySet”.Declaration
Swift
final public var targetPath: String
-
true
if this set was added since metadata was originally loaded.Declaration
Swift
final public var isExtension: Bool
-
Source line number for this schema element within its defining schema.
Declaration
Swift
final public var sourceLine: Int
-
Does this entity set represent an OData singleton entity?
Declaration
Swift
final public var isSingleton: Bool
-
Was this entity set syntheisized to support navigation properties?
Declaration
Swift
final public var isSynthesizedTarget: Bool
-
Secondary indexes to be created in the database.
Declaration
Swift
final public var indexes: EntitySet.IndexList
-
Database table for this entity set.
Declaration
Swift
final public var table: String?
-
For internal use.
Declaration
Swift
final public var tablePrefix: String?
-
Database table type for this entity set. If unset, the default table type depends on the target database.
See also
#constants) (COLUMN_TABLE, ROW_TABLE).
Declaration
Swift
final public var tableType: String?
-
Schema that contains the table.
Declaration
Swift
final public var schema: String?
-
Does this entity set require a generated primary key.
Declaration
Swift
final public var generatedKey: Bool
-
Name of key generator sequence (if
generatedKey
istrue
).Declaration
Swift
final public var keyGenerator: String?
-
Does this entity set use a system-generated surrogate key for persistence, rather than its model-defined primary key.
See also
EntityValue.systemKey
.Declaration
Swift
final public var surrogateKey: Bool
-
Set to
false
to disable change tracking for this entity set. Defaults totrue
.Declaration
Swift
final public var trackChanges: Bool
-
Set to
false
to disable download tracking for this entity set. Defaults totrue
.Declaration
Swift
final public var trackDownloads: Bool
-
Should the affected row count for local deletes be checked, to ensure that each expected deleted row was actually deleted? Defaults to
true
.Declaration
Swift
final public var checkDeletes: Bool
-
Should the affected row count for local updates be checked, to ensure that each expected updated row was actually updated? Defaults to
true
.Declaration
Swift
final public var checkUpdates: Bool
-
Should entities be reselected after create, to ensure that database-generated column values will be available afterwards? Defaults to
true
.Declaration
Swift
final public var selectAfterCreate: Bool
-
Should entities be reselected after update, to ensure that database-generated column values will be available afterwards? Defaults to
true
.Declaration
Swift
final public var selectAfterUpdate: Bool
-
Does this entity set have an error state column?
Declaration
Swift
final public var hasOfflineState: Bool
-
Does this entity set have an offline key column?
Declaration
Swift
final public var hasOfflineKey: Bool
-
Does this entity set have a backend etag column?
Declaration
Swift
final public var hasBackendEtag: Bool
-
Does this entity set have a row version column?
Declaration
Swift
final public var hasVersionColumn: Bool
-
Is this entity set imported from an existing SQL database table?
Declaration
Swift
final public var isImportedFromSQL: Bool
-
Default initializer.
Declaration
Swift
override public init()
-
Lookup an existing annotation by term name, or throw an exception if the annotation is not found.
Declaration
Swift
open func annotation(withName term: String) -> Annotation
Parameters
term
The term name.
Return Value
The annotation.
-
Obsolete. Use
annotations
.Declaration
Swift
open var annotationList: AnnotationList { get }
-
Obsolete. Use
annotations
.Declaration
Swift
open var annotationMap: AnnotationMap { get }
-
Map of annotations for this model element. For annotations without qualifiers, the entry key is the annotation term name. For annotations with qualifiers, the entry key is the annotation term name, then “#”, then the annotation qualifier.
Declaration
Swift
open var annotations: AnnotationMap { get }
-
Lookup an existing navigation property binding by name.
Declaration
Swift
open func binding(withName name: String) -> EntitySet
Parameters
name
Name of the property.
Return Value
The bound entity set.
-
List of default selection items for this entity set.
Declaration
Swift
public final var defaultSelect: SelectItemList { get }
-
For offline scenarios, should entities in this entity set be downloaded by default? Defaults to
true
. SeeOfflineDataService.noDefaultEntityDownload
,CloudSyncProvider.createDownloadQuery
.Declaration
Swift
public final var downloadEntitiesByDefault: Bool { get set }
-
The download group for use in synchronization. Download groups are used for selection of a subset of entity sets to download.
See also
CloudSyncProvider.download
(groups
parameter).Declaration
Swift
public final var downloadGroup: String? { get set }
-
The download mode for use in synchronization. Defaults to
any
. If the download mode isany
, then it will be treated asbatch
ifServiceOptions.batchEntityDownloads
istrue
, asparallel
ifServiceOptions.entityDownloadThreads
is greater than1
, otherwise assequence
.Declaration
Swift
public final var downloadMode: DownloadMode { get set }
-
The download order for use in synchronization. If the
downloadMode
issequence
, then within a download phase entity sets are downloaded in strict sequence of the download order. If thedownloadMode
isbatch
orparallel
, then within a download phase entity sets are started downloading in strict sequence, but due to parallelism and/or next-links, may complete out of sequence.Declaration
Swift
public final var downloadOrder: Int { get set }
-
The download phase for use in synchronization. All entity sets in lower-numbered phases will be downloaded before entity sets in higher-number phases. Defaults to
1
. Zero or negative values will prevent download.Declaration
Swift
public final var downloadPhase: Int { get set }
-
For offline scenarios, can separate download queries for this entity set have overlapping results? Defaults to
false
. Used byCloudSyncProvider.createDownloadQuery
andCloudSyncProvider.deleteDownloadQuery
to enable tracking of downloaded keys in association with download queries, which ensures appropriate deletion of unreferenced entities when one of an overlapping set of download queries is deleted.See also
OfflineDataService.downloadQueriesCanOverlap
.Declaration
Swift
public final var downloadQueriesCanOverlap: Bool { get set }
-
For offline scenarios, should streams in this entity set be downloaded by default? Defaults to
true
. SeeOfflineDataService.noDefaultStreamDownload
.Declaration
Swift
public final var downloadStreamsByDefault: Bool { get set }
-
For offline scenarios, will the client ignore a delta links in responses to change tracking queries for this entity set? Defaults to
false
. If this property is set totrue
, then download requests to the backend service are expected to return all relevant data (as opposed to returning just changed data), in which case the effective changes will be determined on the client side, and applied to the local database as needed. For large data sets, client-side change determination can result in high client-side CPU, memory, and network utilization. It is recommended to use delta-enabled backend services when working with large data sets, instead of setting this property totrue
. If you are considering setting this property totrue
, please evaluate the client-side resource utilization, and consider the alternative option of delta-enabling the backend system.Declaration
Swift
public final var downloadWithoutDeltaLinks: Bool { get set }
-
The percent-encoded
resourcePath
.Declaration
Swift
open var encodedPath: String { get }
-
Entity type for entities in this set.
Declaration
Swift
public final var entityType: EntityType { get set }
-
An estimate of the time in seconds for delta download of this entity set. Setting this property may aid in determination of
OperationProgress.estimatedTimeRemaining
.Declaration
Swift
public final var estimatedDeltaDownloadTime: Double? { get set }
-
An estimate of the time in seconds for initial download of this entity set. Setting this property may aid in determination of
OperationProgress.estimatedTimeRemaining
.Declaration
Swift
public final var estimatedInitialDownloadTime: Double? { get set }
-
An estimate of the time in seconds for stream download of a media entity. Setting this property may aid in determination of
OperationProgress.estimatedTimeRemaining
.Declaration
Swift
public final var estimatedStreamDownloadTime: Double? { get set }
-
Force failure to save downloaded changed entities for this entity set (for testing only).
Declaration
Swift
public final var failBeforeSavingAnyEntity: Bool { get set }
-
Force failure to save downloaded delta links for this entity set (for testing only).
Declaration
Swift
public final var failBeforeSavingDeltaLink: Bool { get set }
-
Is this entity set downloadable?
Declaration
Swift
open var isDownloadable: Bool { get set }
-
Is this a local entity set? A local entity set exists only in the local database (for application use), not the backend system.
Declaration
Swift
open var isLocal: Bool { get set }
-
Is this a system entity set? A system entity set exists only in the local database (for internal use), not the backend system.
Declaration
Swift
open var isSystem: Bool { get set }
-
Is this entity set uploadable?
Declaration
Swift
open var isUploadable: Bool { get set }
-
Metrics for runtime use of this entity set.
Declaration
Swift
public final var metrics: EntitySetMetrics { get }
-
Synonym for
qualifiedName
.Declaration
Swift
open var name: String { get }
-
Map of bindings from navigation properties to entity sets.
Declaration
Swift
public final var pathBindings: EntitySetMap { get }
-
The name of this set as it should be referenced in resource paths before any percent-encoding (e.g. localName for OData V4, qualifiedName for OData V2).
Declaration
Swift
open var resourcePath: String { get set }
-
Declaration
Swift
override open func toString() -> String
Return Value
A string representation of this object.
-
Declaration
Swift
open class func undefinedIfNull(entitySet: EntitySet?) -> EntitySet
Parameters
entitySet
Entity set, or
nil
.Return Value
undefined
ifentitySet
isnil
, otherwise returnentitySet
. -
The upload group for use in synchronization. Upload groups are used for selection of a subset of entity sets to upload.
See also
CloudSyncProvider.upload
(groups
parameter).Declaration
Swift
public final var uploadGroup: String? { get set }
-
Metadata for an index on the containing entity set.
See moreDeclaration
Swift
open class Index : ObjectBase