public final class

OfflineODataQueryFunction

extends QueryFunction
java.lang.Object
   ↳ com.sap.cloud.mobile.odata.QueryFunction
     ↳ com.sap.cloud.mobile.odata.offline.OfflineODataQueryFunction

Class Overview

The class provides Offline OData specific QueryFilter.

See Also
  • com.sap.cloud.mobile.odata.QueryFilter

Summary

[Expand]
Inherited Fields
From class com.sap.cloud.mobile.odata.QueryFunction
Public Methods
static QueryFilter entityExists(DataPath property)
The function creates a QueryFilter to check if a related entity exists.
static QueryFilter hasPendingChanges()
The function creates a QueryFilter to check if an entity has any pending change requests in the request queue.
static QueryFilter inErrorState()
The function creates a QueryFilter to check if an entity is in error state.
static QueryFilter isLocal()
The function creates a QueryFilter to check if an entity is local.
static QueryFilter upsertedLastDownload()
The function creates a QueryFilter to check if an entity was upserted (inserted or updated) in the last download.
[Expand]
Inherited Methods
From class com.sap.cloud.mobile.odata.QueryFunction
From class java.lang.Object

Public Methods

public static QueryFilter entityExists (DataPath property)

The function creates a QueryFilter to check if a related entity exists.

Parameters
property The navigation property path to check for the existence of a related entity
Returns
  • An application of the Offline OData "sap.entityexists" function

public static QueryFilter hasPendingChanges ()

The function creates a QueryFilter to check if an entity has any pending change requests in the request queue.

hasPendingChanges is different from isLocal based on whether or not the change requests have been sent to the backend. An entity that has changes in the request queue that have not been sent will be both local and pending. When the changes in the request queue have been sent to the backend but the results have not been received by a download operation, the entity will be local but NOT pending.

Returns
  • An application of the Offline OData "sap.hasPendingChanges" function.

public static QueryFilter inErrorState ()

The function creates a QueryFilter to check if an entity is in error state.

Returns
  • an application of Offline OData "sap.inerrorstate" function.

public static QueryFilter isLocal ()

The function creates a QueryFilter to check if an entity is local.

An entity is local if there are changes that have been made to the entity that have not yet been downloaded from the backend (regardless of whether or not those operations have been sent to the backend).

Returns
  • an application of Offline OData "sap.islocal" function.

public static QueryFilter upsertedLastDownload ()

The function creates a QueryFilter to check if an entity was upserted (inserted or updated) in the last download.

Note that locally created or modified entities will return true for this function AFTER they have been uploaded and then subsequently downloaded. For example, if the app creates a new entity, performs an upload followed by a download and then includes sap.upsertedlastdownload in a query, the entity that app created will show up in the result. The reason for this is after a create or modification request is uploaded and then the affected entity is downloaded, the local version of the entity is replaced with the server version which may contain additional changes (for example, providing values for key properties).

Returns
  • an application of the Offline OData "sap.upsertedlastdownload" function.