EntityValue

Encapsulates an OData entity value.

Constructors

Link copied to clipboard
constructor()
constructor(withDefaults: Boolean)
constructor(withDefaults: Boolean, type: EntityType?)
constructor(withDefaults: Boolean, type: EntityType?, withIndexMap: SparseIndexMap?)

Construct a new entity value. This constructor is intended for use by custom entity value subclasses. Use {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#ofType(com.sap.cloud.mobile.kotlin.odata.EntityType, com.sap.cloud.mobile.kotlin.odata.core.SparseIndexMap?) EntityValue.ofType} for regular construction.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var changeFlags: Int
Link copied to clipboard
Link copied to clipboard
open override val dataType: DataType
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var entityTag: String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var hasError: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var isBinding: Boolean
Link copied to clipboard
Link copied to clipboard
open var isCreated: Boolean
Link copied to clipboard
open var isDeleted: Boolean
Link copied to clipboard
open var isDraft: Boolean
Link copied to clipboard
open var isLocal: Boolean
Link copied to clipboard
open var isNew: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var isUpdated: Boolean
Link copied to clipboard
open var isUpsert: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var offlineState: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val structureType: StructureType
Link copied to clipboard
open var systemFlags: Int
Link copied to clipboard
open var systemKey: Long
Link copied to clipboard
open override val typeCode: Int
Link copied to clipboard

Functions

Link copied to clipboard
open fun asDraft(): EntityValue

Set {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#isDraft EntityValue.isDraft} to true.

Link copied to clipboard
open fun bindEntity(entity: EntityValue, to: Property)

Bind an entity to a property of the current entity. This can be used before DataService.createEntity or DataService.updateEntity to create or update the bindings of navigation properties.

Link copied to clipboard

Return a copy of this entity value (only structural properties are copied).

Link copied to clipboard
open fun copyKey(from: EntityValue)

Copy the values of all key properties from a specified entity into this entity.

Link copied to clipboard
open override fun copyMutable(): DataValue

Return a clone of this value if it (together with all value subcomponents) is possibly mutable, or return this value if it (together with all value subcomponents) is definitely immutable. The resulting value might share mutable metadata with this query.

Link copied to clipboard
open fun copyProperties(from: EntityValue)

Copy structural/dynamic property values from source entity value into this entity value.

Link copied to clipboard

Set a flag to mark this entity to be copied by a subsequent DataService.makeDraftCopy call, in preparation for a later DataService.activateDraft call that will create the entity. Set {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#cascadePaths EntityValue.cascadePaths} to paths to null.

Link copied to clipboard
open fun forDeepCreate(vararg paths: PropertyPath): EntityValue

Set a flag to mark this entity to be copied by a subsequent DataService.makeDraftCopy call, in preparation for a later DataService.activateDraft call that will create the entity. Set {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#cascadePaths EntityValue.cascadePaths} to paths if paths is non-empty, otherwise set {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#cascadePaths EntityValue.cascadePaths} to null. If paths is empty, the subsequent deep create should include composition children (recursively) which are specified with on-delete-cascade.

See Also:

Create Related Entities When Creating an Entity.

Link copied to clipboard
open fun forDeepUpdate(vararg paths: PropertyPath): EntityValue

Set a flag to mark this entity to be copied by a subsequent DataService.makeDraftCopy call, in preparation for a later DataService.activateDraft call that will update the entity. Set {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#cascadePaths EntityValue.cascadePaths} to paths if paths is non-empty, otherwise set {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#cascadePaths EntityValue.cascadePaths} to null. If paths is empty, the subsequent deep update should include composition children (recursively) which are specified with on-delete-cascade.

See Also:

Update Related Entities When Updating an Entity, {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#bindEntity(com.sap.cloud.mobile.kotlin.odata.EntityValue, com.sap.cloud.mobile.kotlin.odata.Property) EntityValue.bindEntity}, {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#unbindEntity(com.sap.cloud.mobile.kotlin.odata.EntityValue?, com.sap.cloud.mobile.kotlin.odata.Property, kotlin.Boolean) EntityValue.unbindEntity}.

Link copied to clipboard

Set a flag to mark this entity to be copied by a subsequent DataService.makeDraftCopy call, in preparation for a later DataService.activateDraft call that will update the entity. Set {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#cascadePaths EntityValue.cascadePaths} to paths to null.

Link copied to clipboard
open fun generateDraftKey()

Set {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#isDraft EntityValue.isDraft} to true, and set the primary key for this entity to a value likely to be suitable for a local offline draft. For key properties of type int', this will be a value > 2000000000 offset by an amount determined from current UTC dateTime (month/day/hour/minute/second). For key properties of type long', this will be a value > 9000000000000000000 offset by an amount determined from current UTC dateTime (month/day/hour/minute/second). For key properties of type string', 'binary' or 'guid', this will be a random GUID value converted to the appropriate type. For key properties of type string' where the {@link com.sap.cloud.mobile.kotlin.odata.Property#maxLength Property.maxLength} is insufficient to hold a GUID (between 10 and 31 inclusive), then the value will be the string equivalent of the value that would be used for type 'long' or 'int', whichever should fit. For key properties of type `binary' where the {@link com.sap.cloud.mobile.kotlin.odata.Property#maxLength Property.maxLength} is insufficient to hold a complete GUID (less than 16 bytes), then a random GUID value will be truncated to fit. Key properties of any other data type will not be set.

Link copied to clipboard

For internal use only.

Link copied to clipboard
open fun hasKey(): Boolean

Return true if this entity has a value for all key properties.

Link copied to clipboard
open fun inSet(set: EntitySet): EntityValue

Change the entity set for this entity. Having a non-null entity set is optional if only one entity set in the DataService uses the entity type, but is required (before DataService.createEntity is called) if multiple entity sets use the same entity type.

Link copied to clipboard
open override fun isNewOrChanged(property: Property): Boolean

Return true if the value of property property is new or changed, relative to {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#oldEntity EntityValue.oldEntity}.

Link copied to clipboard
fun setChangeFlag(flag: Int, value: Boolean)

For internal use only.

Link copied to clipboard
open fun takeSnapshot()
open fun takeSnapshot(canDefer: Boolean)

Remember a snapshot of the values of structural/dynamic properties of this entity in {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#oldEntity EntityValue.oldEntity}. Snapshots are used to detect which properties have changed when an update is to be issued.

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.DataType#isMutable DataType.isMutable}.

Link copied to clipboard
open override fun toString(): String

Convert this data value to a string. If the {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#dataType EntityValue.dataType} is defined by XML Schema Part 2: Datatypes, then the corresponding lexical format is used. JSON format is used for structured values (arrays and objects).

Link copied to clipboard
open fun unbindEntity(entity: EntityValue?, from: Property)
open fun unbindEntity(entity: EntityValue?, from: Property, deleted: Boolean)

Unbind an entity from a property of the current entity. This can be used before DataService.createEntity or DataService.updateEntity to create or update the bindings of navigation properties.

Link copied to clipboard

Set a flag to mark this entity to be created by a subsequent DataService.activateDraft call. Set {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#cascadePaths EntityValue.cascadePaths} to paths to null.

Link copied to clipboard
open fun withDeepCreate(vararg paths: PropertyPath): EntityValue

Set a flag to mark this entity to be created by a subsequent DataService.activateDraft call, or by a DataService.createEntity call that should perform a deep create. Set {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#cascadePaths EntityValue.cascadePaths} to paths if paths is non-empty, otherwise set {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#cascadePaths EntityValue.cascadePaths} to null. If paths is empty, the subsequent deep create should include composition children (recursively) which are specified with on-delete-cascade.

See Also:

Create Related Entities When Creating an Entity.

Link copied to clipboard
open fun withDeepUpdate(vararg paths: PropertyPath): EntityValue

Set a flag to mark this entity to be updated by a subsequent DataService.activateDraft call, or by a DataService.updateEntity call that should perform a deep update. Set {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#cascadePaths EntityValue.cascadePaths} to paths if paths is non-empty, otherwise set {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#cascadePaths EntityValue.cascadePaths} to null. If paths is empty, the subsequent deep update should include composition children (recursively) which are specified with on-delete-cascade.

See Also:

Update Related Entities When Updating an Entity, {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#bindEntity(com.sap.cloud.mobile.kotlin.odata.EntityValue, com.sap.cloud.mobile.kotlin.odata.Property) EntityValue.bindEntity}, {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#unbindEntity(com.sap.cloud.mobile.kotlin.odata.EntityValue?, com.sap.cloud.mobile.kotlin.odata.Property, kotlin.Boolean) EntityValue.unbindEntity}.

Link copied to clipboard
open fun withKey(key: EntityKey): EntityValue

Change the primary key for this entity.

Link copied to clipboard

Set a flag to mark this entity to be updated by a subsequent DataService.activateDraft call. Set {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#cascadePaths EntityValue.cascadePaths} to paths to null.