jsp - Google App Engine Java Datastore Query - Limit Results? -
i trying fetch entries datastore , need filter them genre: <%@ 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); this return of entries given genre. how can limit e.g. 10 entries? you can use use fetchoptions this datastore.prepare(confquery).aslist(withlimit(10));