[ https://issues.apache.org/jira/browse/OLINGO-807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14983877#comment-14983877 ]
Michael Bolz commented on OLINGO-807: ------------------------------------- Hi [~tobias.stolzenberger], I checked this issue and your suggestion for a possible solution. Furthermore I agree that within the {{JPA extension}} it is not possible to directly set a delta link like in the {{core library}} with the {{org.apache.olingo.odata2.api.ep.callback.TombstoneCallback}} -> {{org.apache.olingo.odata2.api.ep.callback.TombstoneCallbackResult}} and {{setDeltaLink/getDeltaLink}} methods. Based on this I created the branch [OLINGO-807_JPA-Tombstone|https://git1-us-west.apache.org/repos/asf?p=olingo-odata2.git;a=shortlog;h=refs/heads/OLINGO-807_JPA-Tombstone] with a suggestion for a solution. Can you please check if this fulfills your requirements and give feedback. Best Regards, Michael > 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'&!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)