[ 
https://issues.apache.org/jira/browse/OLINGO-112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13886343#comment-13886343
 ] 

Michael Bolz commented on OLINGO-112:
-------------------------------------

Hi Gaurav,

ok, I wasn't aware of that you are using the JPA extensions. So my examples are 
all based on common {{odata2-lib}}.

Nevertheless I think the [above 
example|https://issues.apache.org/jira/browse/OLINGO-112?focusedCommentId=13865463&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13865463]
 should still be applicable for your use case.
[~chandan.v.a]: Perhaps you can explain the JPA/Pagination best practice better.

You extend the {{ODataJPAProcessorDefault}} and override the 
{{readEntitySet(..)}} method as described.

I can provide you the information that the {{valueAccess}} is from type 
{{org.apache.olingo.odata2.ref.processor.BeanPropertyAccess}}.
But in our use case you do not need this class. It is only necessary for a 
generic access in the reference scenarios {{ListsProcessor}}.

In your case you have to know how to skip the first _x_ elements for pagination.
As example if you want _100_ entities on first page and (with id 1 to 100) your 
skip token might be _101_.
A example can also found on the [OData v2 
documentation|http://www.odata.org/documentation/odata-v2-documentation/operations/#21_Retrieving_feeds_Entries_and_service_document].

Perhaps you can also attach your implementation here, so that I get a better 
understanding of our use case. 

Kind regards,
Michael

> how to do pagination
> --------------------
>
>                 Key: OLINGO-112
>                 URL: https://issues.apache.org/jira/browse/OLINGO-112
>             Project: Olingo
>          Issue Type: Question
>            Reporter: Gaurav Garg
>            Assignee: Michael Bolz
>
> I want to implement the pagination in my olingo application in which first 
> few records should be available and for next records there should be link 
> available.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to