我们将演示如何在泛型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.
通过 YQL可以做的不止这些,还包括对结果集分页;从RSS、Atom、XML和HTML文档中提取数据;使用CREATE 和 UPDATE查询添加并修改数据。
You can do a lot more with YQL, including paging result sets; extracting data from RSS, Atom, XML, and HTML documents; and adding and modifying data with CREATE and UPDATE queries.
通过 YQL可以做的不止这些,还包括对结果集分页;从RSS、Atom、XML和HTML文档中提取数据;使用CREATE 和 UPDATE查询添加并修改数据。
You can do a lot more with YQL, including paging result sets; extracting data from RSS, Atom, XML, and HTML documents; and adding and modifying data with CREATE and UPDATE queries.
应用推荐