我们将演示如何在泛型 DAO 中集成数据分页和查询,从而减少代码。
We'll show how you can reduce code by incorporating paging of data and querying in the generic DAO.
清单6必须重新对每个请求执行YQL查询,向分页练习添加时间和性能成本。
Listing 6 must necessarily re-execute the YQL query on each request, adding a time and performance cost to the pagination exercise.
例如,对于查询,mobl暴露了Collection类型,它拥有对实体对象的集合进行过滤、排序和分页的方法。
For instance, for querying, mobl exposes the collection type, which has methods to filter, sort and page the contents of a collection of entity objects. These methods would can be called as follows.
应用推荐