我正在尝试从数据存储区中获取条目,需要按类型过滤它们:
<%@ page import="com.google.appengine.api.datastore.Query.Filter"%>
<%@ page import="com.google.appengine.api.datastore.Query.FilterPredicate"%>
<%@ page import="com.google.appengine.api.datastore.Query.FilterOperator"%>
<%@ page import="com.google.appengine.api.datastore.*"%>
<%@ page import="com.google.appengine.api.datastore.Query.*"%>
Query confQuery = new Query("Track");
Query.Filter topicFilter = new FilterPredicate("genre",
FilterOperator.EQUAL, genre);
confQuery.setFilter(topicFilter);
confQuery.addSort("lastplayed", SortDirection.ASCENDING);
PreparedQuery results = datastore.prepare(confQuery);
这将始终返回具有给定流派的所有条目。如何将此限制为例如10个条目?