[
https://issues.apache.org/jira/browse/OLINGO-807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14988883#comment-14988883
]
Michael Bolz commented on OLINGO-807:
-------------------------------------
Hi [~tobias.stolzenberger],
{quote}
I would not recommend that the application should to the XML or JSON encoding
here as this part should be independent of the requested format
{quote}
This Idea is good, however this would break with the behaviour of the
{{TombstoneCallback, TombstoneCallbackResult}} in the core and the current
{{Producer}} implementation. During serialisation only a already encoded
{{String}} is expected/allowed.
Returning a {{URL}} and adding the *legacy* parameters seems ok for me.
And the Javadoc will be improved as soon as we agree about the solution ;o)
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)