Uploaded image for project: 'Olingo'
  1. Olingo
  2. OLINGO-395

Java client should support the deletion based on locally created entity

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • (Java) V4 4.0.0-beta-01
    • (Java) V4 4.0.0-beta-01
    • odata4-client
    • None

    Description

      this line of code will issue delete request as expected:
      container.getMe().getDrafts().getMessages().delete("msg3_tobedeleted_chh");
      =======================
      DELETE https://xxxx.yyyy.com/EWS/OData/Me/Drafts/Messages('msg3_tobedeleted_chh') HTTP/1.1
      =======================

      but this locally created entity should (1) also create a DELETE request with the key that has been set, (2) or should immediately throw exception of 'invalid DELETE on the unattached entity' :
      Message msg2 = <locally created entity>;
      msg2.setId("sdfafdsds_chh");
      manager.service.getMe().getDrafts().getMessages().delete(msg2);

      =======================
      EntityContext.attach(EntityInvocationHandler, AttachedEntityStatus) line: 107
      EntitySetInvocationHandler<T,KEY,EC>.delete(S) line: 266
      NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
      NativeMethodAccessorImpl.invoke(Object, Object[]) line: 57
      DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
      Method.invoke(Object, Object...) line: 606
      EntitySetInvocationHandler<T,KEY,EC>(AbstractInvocationHandler).invokeSelfMethod(Method, Object[]) line: 88
      EntitySetInvocationHandler<T,KEY,EC>.invoke(Object, Method, Object[]) line: 91
      $Proxy18.delete(EntityType) line:
      =======================

      Attachments

        Activity

          People

            fmartelli Fabio Martelli
            challenh Challen He
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: