public final class ODataQueryBuilder extends Object implements IQueryBuilder
| Modifier and Type | Class and Description |
|---|---|
class |
ODataQueryBuilder.ODataQueryResolver |
| Modifier and Type | Field and Description |
|---|---|
static char |
QUERY_PARAM_SEPARATOR |
| Modifier and Type | Method and Description |
|---|---|
ODataQuery |
build()
Builds an OData query from this builder.
|
ODataQueryBuilder |
enableMetadataCache()
Enables caching of the metadata of an OData V2 data source.
|
ODataQueryBuilder |
enableMetadataCache(com.sap.cloud.sdk.cloudplatform.cache.CacheKey cacheKey)
Enables caching of the metadata of an OData V2 data source.
|
ODataQueryBuilder |
expand(String... expands)
Selects navigation properties to expand.
|
ODataQueryBuilder |
filter(FilterExpression filter)
Adds a Filter expression to the OData query.
|
ODataQueryBuilder |
inlineCount()
Sets $inlinecount=allpages as a query parameter.
|
ODataQueryBuilder |
keys(Map<String,Object> keys)
Set Keys for the entity set being queried
|
ODataQueryBuilder |
navigateTo(String navigation)
Adds navigation Property to the URL.
|
ODataQueryBuilder |
param(String key,
Object value)
Adds a query parameter to the OData request.
|
ODataQueryBuilder |
select(List<String> selects)
Selects properties to read.
|
ODataQueryBuilder |
select(String... selects)
Selects properties to read.
|
ODataQueryBuilder |
skip(Integer n)
Sets skip value.
|
ODataQueryBuilder |
top(Integer n)
Sets top value.
|
ODataQueryBuilder |
useMetadata(boolean useMetadata) |
ODataQueryBuilder |
withCacheRefresh()
Replaces the existing metadata in the cache with the latest version from the OData V2 data source.
|
static ODataQueryBuilder |
withEntity(String servicePath,
String entity)
Creates an ODataQueryBuilder with the given service and entity name.
|
ODataQueryBuilder |
withHeader(String key,
String value)
Adds a header to the query request.
|
ODataQueryBuilder |
withHeader(String key,
String value,
boolean passInAllRequests)
Adds a header to the query request and optionally to the metadata request as well depending on the value of the
passInAllRequests parameter.
|
ODataQueryBuilder |
withMetadata(URL metadataFilePath)
Gets the metadata from the specified path.
|
ODataQueryBuilder |
withoutMetadata()
Used to tell the framework to not get the metadata before the actual query.
|
public static final char QUERY_PARAM_SEPARATOR
public static ODataQueryBuilder withEntity(String servicePath, String entity)
serviceName - name of the odata service where the developer wants to execute a query operation.entitySetName - name of the entity set, on which the developer wants to execute a query operation.public ODataQueryBuilder select(String... selects)
select in interface IQueryBuilderselects - The list of properties to be read.public ODataQueryBuilder select(List<String> selects)
select in interface IQueryBuilderselects - of type List- The list of properties to be read.public ODataQueryBuilder enableMetadataCache()
enableMetadataCache in interface IQueryBuilderpublic ODataQueryBuilder enableMetadataCache(com.sap.cloud.sdk.cloudplatform.cache.CacheKey cacheKey)
enableMetadataCache in interface IQueryBuilderkey - Cache key containing the ID of the tenant where the application runs. You can also include the user name in the cache key.public ODataQueryBuilder withCacheRefresh()
withCacheRefresh in interface IQueryBuilderpublic ODataQueryBuilder withMetadata(URL metadataFilePath)
withMetadata in interface IQueryBuildermetadataFilePath - URL pointing to the metadata informationpublic ODataQueryBuilder withHeader(String key, String value)
withHeader in interface IQueryBuilderkey - name of the headervalue - value of the headerpublic ODataQueryBuilder withHeader(String key, String value, boolean passInAllRequests)
withHeader in interface IQueryBuilderkey - name of the headervalue - value of the headerpassInAllRequests - boolean indicating whether the header is to be passed in all the requests to the backend like $metadata call etc. made as part of the Query Request call.public ODataQueryBuilder inlineCount()
inlineCount in interface IQueryBuilderpublic ODataQueryBuilder expand(String... expands)
expand in interface IQueryBuilderexpands - List of navigation properties to expandpublic ODataQueryBuilder top(Integer n)
top in interface IQueryBuildern - the top value requiredpublic ODataQueryBuilder skip(Integer n)
skip in interface IQueryBuildern - the skip value requiredpublic final ODataQueryBuilder filter(FilterExpression filter)
filter in interface IQueryBuilderfilter - Object of FilterExpression that represents an OData filter expression.public ODataQueryBuilder param(String key, Object value)
param in interface IQueryBuilderkey - value - public ODataQueryBuilder withoutMetadata()
withoutMetadata in interface IQueryBuilderpublic ODataQueryBuilder keys(Map<String,Object> keys)
keys in interface IQueryBuilderkeys - public ODataQueryBuilder useMetadata(boolean useMetadata)
useMetadata in interface IQueryBuilderpublic ODataQuery build()
build in interface IQueryBuilderpublic ODataQueryBuilder navigateTo(String navigation)
IQueryBuildernavigateTo in interface IQueryBuilderCopyright © 2020 SAP. All Rights Reserved.