You won't have to store the list, just get the count of the keys to start 
with.

public long queryTotal() {
    long total = 0;
    PersistenceManager pm = sp.getPersistenceManager();
    try {
      Query q = pm.newQuery("select stuffIdKey from " + 
ThingStuffJdo.class.getName());
      List<Key> ids = (List<Key>) q.execute();
      total = ids.size();
      q.closeAll();
    } catch (Exception e) { 
      e.printStackTrace();
      log.log(Level.SEVERE, "", e);
    } finally {
      pm.close();
    }
    return total;
  }

Once you get the total count, they you can page through your regular query 
using a range or 

like in http://code.google.com/appengine/docs/java/datastore/queries.html 
fetching results section.

Brandon Donnelson
http://gwt-examples.googlecode.com

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to