[Java programming language only]

Delete requests with REST data services

The WebSphere® eXtreme Scale REST data service can delete entities, property values and links.

Delete an entity

The DeleteEntity Request can delete an eXtreme Scale entity from the REST data service.

If any relation to the to-be-deleted entity has cascade-delete set, then the eXtreme Scale Rest data service will delete the related entity or entities. For more details on the DeleteEntity request, refer to MSDN Library: DeleteEntity Request.

The following DeleteEntity request deletes the customer with key 'IBM'.
  • Method: DELETE
  • Request URI: http://localhost:8080/wxsrestservice/restservice/NorthwindGrid/Customer('IBM')
  • Request Payload: None
  • Response Payload: None
  • Response Code: 204 No Content

Delete a property value

The DeleteValue Request sets an eXtreme Scale entity property to null.

Any property of an eXtreme Scale entity can be set to null with a DeleteValue request. To set a property to null, ensure all of the following:
  • For any primitive number type and its wrapper, BigInteger, or BigDecimal, the property value is set to 0.
  • For Boolean or boolean type, the property value is set to false.
  • For char or Character type, the property value is set to character #X1 (NIL).
  • For enum type, the property value is set to the enum value with ordinal 0.
  • For all other types, the property value is set to null.

However, such a delete request could be rejected by the database backend if, for example, the property is not nullable in the database. In this case, the REST data service returns a 500 (Internal Server Error) response. For more details on the DeleteValue request, refer to: MSDN Library: DeleteValue Request.

Here is a DeleteValue request example. In this example, we set the contact name of Customer('IBM') to null.

  • Method: DELETE
  • Request URI: http://localhost:8080/wxsrestservice/restservice/NorthwindGrid/Customer('IBM')/contactName
  • Request Payload: None
  • Response Payload: None
  • Response Code: 204 No Content

Delete a link

The DeleteLink request can removes an association between two eXtreme Scale entity instances. The association can be a to-one relation or a to-many relation. However, such a delete request could be rejected by the database backend if, for example, the foreign key constraint is set. In this case, the REST data service returns a 500 (Internal Server Error) response. For more details on the DeleteLink request, refer to: MSDN Library: DeleteLink Request.

The following DeleteLink request removes the association between Order(101) and its associated Customer.

  • Method: DELETE
  • Request URI: http://localhost:8080/wxsrestservice/restservice/NorthwindGrid/Order(101)/$links/customer
  • Request Payload: None
  • Response Payload: None
  • Response Code: 204 No Content