public static final class

OfflineODataRequestOptions.UploadCategory

extends Object
java.lang.Object
   ↳ com.sap.cloud.mobile.odata.offline.OfflineODataRequestOptions.UploadCategory

Class Overview

The class represents an UploadCategory instance.

To use UploadCategory when partial upload is needed.

Here is an example of creating a Customer and a related Order and having both is true. operations use the new Customer's entity ID as the upload category so that they both get put in the same upload category:

 EntityValue newCustomer = EntityValue.ofType( customerEntityType );
 EntityValue newOrder = EntityValue.ofType( orderEntityType );

 // Fill in newCustomer and newOrder properties here...

 // This will create the new customer and the upload category of the request
 // will be the generated entity ID.
 OfflineODataRequestOptions createCustomerOptions = new OfflineODataRequestOptions()
 createCustomerOptions.setUploadCategory( UploadCategory.UseGeneratedIDForUploadCategory );
 service.createRelatedEntity( orderEntityType, customerEntityType, ordersNavigationProperty, HttpHeaders.empty, createCustomerOptions );
 
 

Summary

Fields
public static final OfflineODataRequestOptions.UploadCategory useGeneratedIDForUploadCategory A constant to specify to use the generated entity ID for a created entity or media entity as the upload category for the request.
Public Constructors
UploadCategory(String value)
Sets a pre-defined string as the upload category.
UploadCategory(EntityValue value)
Sets the entity ID of the specified EntityValue as the upload category.
Public Methods
EntityValue getEntityValue()
Returns the entity value if upload category is EntityValue.
String getStringLiteral()
Returns the string value if upload category is StringLiteral.
OfflineODataRequestOptions.UploadCategoryType getUploadCategoryType()
Returns the UploadCategoryType.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public static final OfflineODataRequestOptions.UploadCategory useGeneratedIDForUploadCategory

A constant to specify to use the generated entity ID for a created entity or media entity as the upload category for the request. Using the generated entity ID as an upload category is ideal for cases where requests for a new entity need to be grouped into an upload category but there is no other pre-defined upload category. Using the generated entity ID as an upload category is also ideal for cases where a graph of related entities (for example, a parent-child hierarchy) needs to be grouped into an upload category and the entity ID of the to be created root is the ideal choice for the upload category. Note that this can be used in a change set and subsequent requests in the change set can reference the created entity (by EntityValue) to also be grouped in the same upload category.

Public Constructors

public UploadCategory (String value)

Sets a pre-defined string as the upload category.

Parameters
value the string value, the value can not be empty or contains only white spaces.

public UploadCategory (EntityValue value)

Sets the entity ID of the specified EntityValue as the upload category. This is a convenient way to have a graph of entities (for example, a parent-child hierarchy) all be grouped into the same upload category by referencing the root entity as the upload category.

Parameters
value the entity value.

Public Methods

public EntityValue getEntityValue ()

Returns the entity value if upload category is EntityValue.

Returns
  • the entity value if upload category is EntityValue.

public String getStringLiteral ()

Returns the string value if upload category is StringLiteral.

Returns
  • the string value if upload category is StringLiteral.

public OfflineODataRequestOptions.UploadCategoryType getUploadCategoryType ()

Returns the UploadCategoryType.

Returns
  • the UploadCategoryType is used.