Version Support and Limitations¶
Offline OData supports OData versions 2.0, 4.0, and 4.01 with some limitations.
OData Version 2.0 Support and Limitations¶
Offline OData supports a mix of OData Version 2.0 and 4.0 metadata annotations for defining additional characteristics or capabilities of a metadata element, such as a service, entity type, property, function, action, or parameter. For example, you can define a valid range of values for a particular property.
There is no support for the following OData concepts:
- ETags when using the
if-match/if-none-match
headers when performing local reads. - Modifying properties or complex type properties by addressing them in the URL.
Offline OData has the following limitations:
- The maximum length (
MaxLength
) ofEdm.String
key properties is 10922 characters andMaxLength
must be present in the metadata. - The maximum length (
MaxLength
) ofEdm.Binary
key properties is 32768 bytes andMaxLength
must be present in the metadata. - If the back end cannot respond with child entities in the same order as the request, then the navigation property used for deep insert must refer to at most one entity.
- Media resources can't be read in a batch request.
- The mobile service does not provide the capability to use No Rewriting mode to support external back ends for offline usage.
- Requests to read OData service metadata cannot include query options.
-
Relationships may not be reflected on the client until after a download.
If the offline application uses only a referential constraint property to create or modify a relationship, the new or updated relationship is not reflected locally until the modification request is uploaded, and then the result is downloaded.
Note
There are several methods available to see the relationships locally. For example, have the gateway back end ignore a bind operation (another operation in OData creating or modifying relationships that can be reflected locally), and locally use both a bind operation and update a referential constraint property. When doing this, the relationship is reflected locally using the bind, but the relationship is created/modified in the back end using the referential constraint property. This workaround may be necessary when a back end does not support bind operations or
$links
. If it supports either, updating the relationships using referential constraint properties is unnecessary. -
Metadata annotations are not populated in the metadata object.
Keep in mind the following points about custom query options:
- For modification requests, custom query options are not passed to the back end. However, if the offline application requires custom behavior, the developer can set custom headers and custom cookies per request that are sent to the back end.
- For defining queries, the custom query options are sent to the back end. In this case, the exact URL that the offline application gives, or the associated delta link provided by the back end, is sent. On the other hand, currently, custom query options are not sent when retrieving the metadata or service document.
Limitations with Deep Inserts¶
A deep insert is an OData POST
request to create an entity that also contains inline related entities.
When a deep insert is processed, the top-level entity and all of its related entities are created and related together as a single operation. Offline OData supports deep inserts, except in the case where the back end cannot respond with child entities in the same order as the request:
The navigation property used for the deep insert must refer to at most one
entity. The inline entity must be added using a navigation property for which the ToRole
refers to an association end with cardinality 0..1 or 1. Inline entities cannot be added using a navigation property for which ToRole
refers to an association end with cardinality *
. A navigation property that refers to a set of entities cannot be used for deep inserts.
Note
Deep insert is only one way to create relationships; there are others.
SAP Annotations for OData Version 2.0¶
See the SAP Community Network (SCN) at http://scn.sap.com/docs/DOC-44986 for a list of OData extensions supported by the SDK.
OData Version 4.0 Support and Limitations¶
Offline OData supports two OData Version 4.0 lambda operators, any
and all
.
-
Support OData version 4.0 with the following new features:
- Enum type
- Stream property
- Collection property
- Bound/Unbound action and function with simple, complex, and entity type parameters
- Exponential decimal
OnDelete
action for navigation property
-
Support OData version 4.0 with the following limitations:
- OData Atom (
xml
) is not supported - Content-ID referencing in body and Content-ID referencing across change sets are not supported
- Binds for a collection of value navigation properties in a PATCH request are not supported
- Modification operations in batches outside of change sets are not supported
- Bound/Unbound action and function with collection type parameters are not supported
- Singleton is not supported
- Derived entities are not supported
- Containment navigation properties are not supported
$filter
operations on date (such as add and sub) are not supported$filter
and$orderby
operations on spatial types are not supported- Default value of spatial types is not supported
- Key properties of spatial types are not supported
- System query options $search and $index are not supported
- Built-in functions or literals:
geo.distance
,geo.intersects
,geo.length
,case
,$level
,$all
,$each
,$it
, and$root
are not supported Upserting
an entity is not supported
- OData Atom (
Limited Support for OData Version 4.01¶
Currently only the following OData version 4.01 new features are supported:
- OData 4.0.1 new JSON format:
- Control information without prefix
odata.
- Improved exponential notation for decimals
- Control information without prefix