Implementation of an OData V2 model's context.
The context is a pointer to model data. A context for a context binding points to the complete query result. A context for a list binding points to one specific entry in the binding's collection.
A context for the OData V2 model cannot be created at will, it has to be retrieved via:
Method | Description |
---|---|
created |
Returns a promise on the creation state of this context if it has been created via sap.ui.model.odata.v2.ODataModel#createEntry; otherwise returns As long as the promise is not yet resolved or rejected, the entity represented by this context is transient. Once the promise is resolved, the entity for this context is stored in the back end and #getPath returns a path including the key predicate of the new entity. |
sap.ui.model.odata.v2.Context.extend |
Creates a new subclass of class sap.ui.model.odata.v2.Context with name
|
sap.ui.model.odata.v2.Context.getMetadata |
Returns a metadata object for class sap.ui.model.odata.v2.Context. |
isPreliminary |
Whether this context's path may be used to create the request URL for dependent bindings even if no data has been loaded for the context's entity. This can be used by dependent bindings to send their requests in parallel to the request of the context binding. |
isTransient |
For a context created using sap.ui.model.odata.v2.ODataModel#createEntry, the method returns |
Returns a promise on the creation state of this context if it has been created via sap.ui.model.odata.v2.ODataModel#createEntry; otherwise returns undefined
.
As long as the promise is not yet resolved or rejected, the entity represented by this context is transient.
Once the promise is resolved, the entity for this context is stored in the back end and #getPath returns a path including the key predicate of the new entity.
Creates a new subclass of class sap.ui.model.odata.v2.Context with name sClassName
and enriches it with the information contained in oClassInfo
.
oClassInfo
might contain the same kind of information as described in sap.ui.model.Context.extend.
Param | Type | DefaultValue | Description |
---|---|---|---|
sClassName | string |
Name of the class being created |
|
oClassInfo | object |
Object literal with information about the class |
|
FNMetaImpl | function |
Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class |
Returns a metadata object for class sap.ui.model.odata.v2.Context.
Whether this context's path may be used to create the request URL for dependent bindings even if no data has been loaded for the context's entity. This can be used by dependent bindings to send their requests in parallel to the request of the context binding.
For a context created using sap.ui.model.odata.v2.ODataModel#createEntry, the method returns true
if the context is transient or false
if the context is not transient. A transient context represents an entity created on the client which has not been persisted in the back end.