Hi,

>From my understanding queries return a maximum of 1000 entities, and
the largest starting index you can use is either 999 or 1000.  This
means you'll never be able to access more than the first 2000 entities
from the datastore for a particular query, regardless of the code in
place after the fetch.

Mike


On Aug 17, 5:17 am, hzqtc <[email protected]> wrote:
> Hi,
>
> I'm new to app engine and I have a question when I come to this
> sentence:"a query will never return more than 1000 enties". If I
> execute a query and store the return result in a List, but I don't
> detach them, i.e., keep them in the persitent manager. And the entries
> in that List is beyond 1000, would it be possible?
>
> For example:
>
>         public void updateIndex(int from, int value)
>         {
>                 PersistenceManager pm = PMF.get().getPersistenceManager();
>                 Query query = pm.newQuery(Article.class);
>                 query.setFilter(String.format("index >= %d", from));
>                 try
>                 {
>                         List<Article> articles = 
> (List<Article>)query.execute();
>                         for(Article article: articles)
>                         {
>                                 article.setIndex(article.getIndex() + value);
>                                 pm.makePersistent(article);
>                         }
>                 }
>                 finally
>                 {
>                         query.closeAll();
>                         pm.close();
>                 }
>         }
>
> If the query returns 2000 entries, will it work or not? If not, would
> you please recommend me a alternative way?
> Thank you very much.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" 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-java?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to