You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Michael Bolz (JIRA)" <ji...@apache.org> on 2015/10/26 19:03:27 UTC

[jira] [Assigned] (OLINGO-807) ODataJPATombstoneEntityListener uses delta token instead of delta link

     [ https://issues.apache.org/jira/browse/OLINGO-807?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bolz reassigned OLINGO-807:
-----------------------------------

    Assignee: Michael Bolz

> ODataJPATombstoneEntityListener uses delta token instead of delta link
> ----------------------------------------------------------------------
>
>                 Key: OLINGO-807
>                 URL: https://issues.apache.org/jira/browse/OLINGO-807
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-jpa
>    Affects Versions: V2 2.0.5
>            Reporter: Tobias Stolzenberger
>            Assignee: Michael Bolz
>
> I have a scenario which requires delta handling in combination with query options. The OData consumer for example uses filters to get data. For example:
> GET http://myhost/myService/MyEntity?$filter=name eq 'test'
> For performance reasons the server should return the data including a delta link. In this delta link I require the query options of the original request such as:
>  <link rel="delta" href="http://myhost/myService/MyEntity?$filter=name eq 'test'&amp;!deltatoken=20151009-112156372"/>
> If you use the Olingo core libraries (org.apache.olingo.odata2.api.ep.callback.TombstoneCallbackResult) you an return any URL here by implementing getDeltaLink()
> But when you use the JPA adapter (org.apache.olingo.odata2.jpa.processor.api.ODataJPATombstoneEntityListener) you can only return the delta token but not the delta link. As a consequence of this you can only return a delta link like this:
>  <link rel="delta" href="http://myhost/myService/MyEntity?!deltatoken=20151009-112156372"/>
> Via trial and error I found that you can implement method ODataJPATombstoneEntityListener#generateDeltaToken(List<Object>, Query) and return a delta token plus filter parameters. But for me this looks like a bug as the returned delta token should be URL escaped.
> My proposal is to add an additional method in class ODataJPATombstoneEntityListener:
>  public String generateDeltaLink(List<Object> deltas, Query query){ return null; }
> In its default implementation this method return null to keep it compatible with previous releases. The idea is that the JPA processor should first call the new callback method generateDeltaLink. If this returns a value != null than this value should be used as href of the delta link. Otherwise the existing logical applies.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)