QueryResult

open class QueryResult

Holds a data query and its result value. Allows conversion of the result to optional/required/list values for basic, complex and entity types.

Constructors

Link copied to clipboard
constructor(query: DataQuery, result: DataValue?)
constructor(query: DataQuery, result: DataValue?, status: Int)
constructor(query: DataQuery, result: DataValue?, status: Int, error: DataServiceException?)

Construct a new query result.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
open val query: DataQuery
Link copied to clipboard
open val result: DataValue?
Link copied to clipboard
open val status: Int

Functions

Link copied to clipboard
open fun check()
open fun check(fixOptions: Int)

Check if the {@link com.sap.cloud.mobile.kotlin.odata.QueryResult#result QueryResult.result} is valid with respect to the {@link com.sap.cloud.mobile.kotlin.odata.QueryResult#query QueryResult.query}. A result will be considered invalid if it is missing properties that were expected according to the use of {@link com.sap.cloud.mobile.kotlin.odata.DataQuery#select(com.sap.cloud.mobile.kotlin.odata.PropertyPath...) DataQuery.select} or {@link com.sap.cloud.mobile.kotlin.odata.DataQuery#expand(com.sap.cloud.mobile.kotlin.odata.PropertyPath...) DataQuery.expand} in the {@link com.sap.cloud.mobile.kotlin.odata.QueryResult#query QueryResult.query}.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.QueryResultException} if the result is definitely not valid.

Link copied to clipboard

Return the basic list for this result.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.QueryResultException} if the result does not have the expected type.

Link copied to clipboard

Return the byte stream for this result.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.QueryResultException} if the result does not have the expected type.

Link copied to clipboard

Return the character stream for this result.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.QueryResultException} if the result does not have the expected type.

Link copied to clipboard

Return (nullable) The expected {@link com.sap.cloud.mobile.kotlin.odata.QueryResult#result QueryResult.result}, or throw {@link com.sap.cloud.mobile.kotlin.odata.QueryResult#error QueryResult.error} if it is non-null.

Link copied to clipboard

Return the complex list for this result.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.QueryResultException} if the result does not have the expected type.

Link copied to clipboard
open fun getCount(): Long

Return the "count" for this result.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.QueryResultException} if the result does not have the expected type.

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.DataQuery#count() DataQuery.count}, Requesting the Number of Items in a Collection.

Link copied to clipboard
open fun getDeltaLink(): String?

Return (nullable) The "delta link" for this result.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.QueryResultException} if the result does not have the expected type.

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.EntityValueList#deltaLink EntityValueList.deltaLink}.

Link copied to clipboard

Return the delta stream for this result.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.QueryResultException} if the result does not have the expected type.

Link copied to clipboard

Return the entity list for this result.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.QueryResultException} if the result does not have the expected type.

Link copied to clipboard

Return the entity stream for this result.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.QueryResultException} if the result does not have the expected type.

Link copied to clipboard
open fun getInlineCount(): Long

Return the inline "total count" for this result.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.QueryResultException} if the result does not have an inline "total count".

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.DataQuery#inlineCount() DataQuery.inlineCount}, System Query Option $count.

Link copied to clipboard
open fun getNextLink(): String?

Return (nullable) The "next link" for this result.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.QueryResultException} if the result does not have the expected type.

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.EntityValueList#nextLink EntityValueList.nextLink}.

Link copied to clipboard

Return the "next query" for this result. The query will have a non-null URL if this result includes a nextLink.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.QueryResultException} if the result does not have the expected type.

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.EntityValueList#nextLink EntityValueList.nextLink}.

Link copied to clipboard

Return (nullable) The optional basic value of this result.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.QueryResultException} if the result does not have the expected type.

Link copied to clipboard

Return (nullable) The optional complex value of this result.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.QueryResultException} if the result does not have the expected type.

Link copied to clipboard

Return (nullable) The optional entity value of this result.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.QueryResultException} if the result does not have the expected type.

Link copied to clipboard

Return the required basic value of this result.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.QueryResultException} if the result does not have the expected type.

Link copied to clipboard

Return the required complex value of this result.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.QueryResultException} if the result does not have the expected type.

Link copied to clipboard

Return the required entity value of this result.

Throws:

{@link com.sap.cloud.mobile.kotlin.odata.QueryResultException} if the result does not have the expected type.

Link copied to clipboard
open fun resolveDataPaths()

Resolve the {@link com.sap.cloud.mobile.kotlin.odata.StructureBase#dataPath StructureBase.dataPath} for each structure in the graph of this query result.

Link copied to clipboard

Return this query result, after calling {@link com.sap.cloud.mobile.kotlin.odata.StructureBase#setDefaultValues(kotlin.Boolean, kotlin.Boolean, kotlin.Boolean, kotlin.Boolean, kotlin.Boolean) StructureBase.setDefaultValues} on all structures within the {@link com.sap.cloud.mobile.kotlin.odata.QueryResult#result QueryResult.result}.