Version Support and Limitations
OData Version 2.0 is supported by Offline OData, with several exceptions.
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 service, entity type, property, function, action, or parameter. For example, you can define a valid range of values for a particular property.
Offline OData supports two OData Version 4.0 lambda operators, any and all.
There is no support for the following OData concepts:
- Function imports.
- 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) of
Edm.Stringkey properties is 10922 characters and MaxLength must be present in the metadata.
- The maximum length (MaxLength) of
Edm.Binarykey properties is 32768 bytes and MaxLength must be present in the metadata.
- The navigation property used for the deep insert must refer to at most one entity.
- Media resources can't be read in a batch request.
- The mobile services do not provide the functionality 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 an offline application uses only a referential constraint property to create or modify a relationship, the new or updated relationship is not reflected in the local store until the modification request is uploaded, and then the result is downloaded.
There are several means if you want 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 updating 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 provides 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 its related entities are created and related together as a single operation.
Offline OData supports deep inserts, except for the following important restriction:
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.
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 SAP Annotations for OData Version 2.0 for a list of OData extensions supported by the SDK.