OfflineODataQueryFunction

public class OfflineODataQueryFunction : QueryFunction

A class used to call Offline OData specific $filter functions.

  • The Offline OData specific function 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).

    Declaration

    Swift

    public static func isLocal() -> QueryFilter

    Return Value

    An application of the Offline OData sap.islocal function.

  • The Offline OData specific function 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.

    Declaration

    Swift

    public static func hasPendingChanges() -> QueryFilter

    Return Value

    An application of the Offline OData sap.hasPendingChanges function.

  • The Offline OData specific function to check if an entity is in the error state.

    Declaration

    Swift

    public static func inErrorState() -> QueryFilter

    Return Value

    An application of the Offline OData ‘sap.inerrorstate’ function.

  • The Offline OData specific function to check if a related entity exists.

    Declaration

    Swift

    public static func entityExists(_ property: DataPath) -> QueryFilter

    Parameters

    property

    The navigation property path to check for the existance of a related entity.

    Return Value

    An application of the Offline OData sap.entityexists function.

  • The Offline OData specific function 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).

    Declaration

    Swift

    public static func upsertedLastDownload() -> QueryFilter

    Return Value

    An application of the Offline OData ‘sap.upsertedlastdownload’ function.