public class ODataCreateRequestBuilder extends Object
| Modifier and Type | Method and Description |
|---|---|
ODataCreateRequest |
build()
Builds an ODataCreateRequest from this builder.
|
ODataCreateRequestBuilder |
enableMetadataCache()
Enables caching of the metadata of an OData V2 data source.
|
ODataCreateRequestBuilder |
enableMetadataCache(com.sap.cloud.sdk.cloudplatform.cache.CacheKey cacheKey)
Enables caching of the metadata of an OData V2 data source.
|
ODataCreateRequestBuilder |
onNavigationProperty(String navigationProperty,
Map<String,Object> keyMap)
Creates an entity related to a source entity using the navigation property.
|
ODataCreateRequestBuilder |
withBody(Map<String,Object> entityData)
Deprecated.
|
ODataCreateRequestBuilder |
withBodyAs(Object pojoData)
This method is used to create the request body based on a POJO object
|
ODataCreateRequestBuilder |
withBodyAsMap(Map<String,Object> entityData)
Sets the passed map for the payload of an OData create request.
|
ODataCreateRequestBuilder |
withCacheRefresh()
Replaces the existing metadata in the cache with the latest version from the OData V2 data source.
|
static ODataCreateRequestBuilder |
withEntity(String serviceName,
String entitySetName)
Creates an ODataCreateRequestBuilder with the given service and entity name.
|
ODataCreateRequestBuilder |
withErrorHandler(ErrorResultHandler<?> errorHandler)
Sets an error handler to this ODataCreateRequestBuilder.
|
ODataCreateRequestBuilder |
withHeader(String key,
String value)
Adds a header to the create request.
|
ODataCreateRequestBuilder |
withHeader(String key,
String value,
boolean passInAllRequests)
Adds a header to the create request and optionally to the metadata request as well depending on the value of the
passInAllRequests parameter.
|
ODataCreateRequestBuilder |
withMetadata(URL metadataFilePath)
Gets the metadata from the specified path.
|
public static ODataCreateRequestBuilder withEntity(String serviceName, String entitySetName)
serviceName - name of the odata service where the developer wants to execute a Create operation.entitySetName - name of the entity set, on which the developer wants to execute a Create operation@Deprecated public ODataCreateRequestBuilder withBody(Map<String,Object> entityData)
public ODataCreateRequestBuilder withBodyAsMap(Map<String,Object> entityData)
entityData - public ODataCreateRequestBuilder withErrorHandler(ErrorResultHandler<?> errorHandler)
errorHandler - public ODataCreateRequestBuilder withHeader(String key, String value)
key - name of the headervalue - value of the headerpublic ODataCreateRequestBuilder withHeader(String key, String value, boolean passInAllRequests)
key - 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, CSRF Token fetch etc. made as part of the Create Request callpublic ODataCreateRequestBuilder enableMetadataCache()
public ODataCreateRequestBuilder enableMetadataCache(com.sap.cloud.sdk.cloudplatform.cache.CacheKey cacheKey)
key - Cache key containing the ID of the tenant where the application runs. You can also include the user name and other parameters in the cache key.public ODataCreateRequestBuilder withCacheRefresh()
public ODataCreateRequestBuilder withMetadata(URL metadataFilePath)
metadataFilePath - URL pointing to the metadata informationpublic ODataCreateRequest build()
public ODataCreateRequestBuilder withBodyAs(Object pojoData)
pojoData - - An instance of POJO classpublic ODataCreateRequestBuilder onNavigationProperty(String navigationProperty, Map<String,Object> keyMap)
navigationProperty - Navigation property of the source entitykeyMap - Key of the source entity, which can also be a composite keyCopyright © 2020 SAP. All Rights Reserved.