@Override
  public ODataEntityUpdateRequest getEntityUpdateRequest(
      final URI targetURI, final UpdateType type, final ODataEntity changes) {

    final ODataEntityUpdateRequest req;

    if (client.getConfiguration().isUseXHTTPMethod()) {
      req = new ODataEntityUpdateRequest(client, HttpMethod.POST, targetURI, changes);
      req.setXHTTPMethod(type.getMethod().name());
    } else {
      req = new ODataEntityUpdateRequest(client, type.getMethod(), targetURI, changes);
    }

    return req;
  }
  @Override
  public ODataEntityUpdateRequest getEntityUpdateRequest(
      final UpdateType type, final ODataEntity entity) {
    if (entity.getEditLink() == null) {
      throw new IllegalArgumentException("No edit link found");
    }

    final ODataEntityUpdateRequest req;

    if (client.getConfiguration().isUseXHTTPMethod()) {
      req = new ODataEntityUpdateRequest(client, HttpMethod.POST, entity.getEditLink(), entity);
      req.setXHTTPMethod(type.getMethod().name());
    } else {
      req = new ODataEntityUpdateRequest(client, type.getMethod(), entity.getEditLink(), entity);
    }

    return req;
  }