Pagination in Google App Engine with Java

后端 未结 4 432
攒了一身酷
攒了一身酷 2021-01-12 11:23

I need to create simple pagination of objects, but when I read manual I found out that query.setRange(5, 10); will fetch 10 objects, even when only 5 objects are needed.

4条回答
  •  一整个雨季
    2021-01-12 11:41

    There's an article about this very topic on the App Engine site:

    http://code.google.com/appengine/articles/paging.html

    The examples are in Python, but they're simple enough that you can probably translate to Java fairly easily.

    Here's a Java implementation, which I have not read or tested.

提交回复
热议问题