因为GAE规定了返回的条数不能超过1000条,所以只能分两种做法:
当记录的条数小于1000的时候:
PersistenceManager pm = getPersistenceManager();
Query query = pm.newQuery(Chapter.class);
query.setResult("count(this)");
int count = 0;
try {
count = (Integer) query.execute();
} finally {
pm.close();
}
当记录的条数大于1000的时候:
最有效的方法是新建一个表,一个counter字段来记录总记录数目。(原话:the most efficient solution would be incrementing a
counter with every write and just reading this value when it's needed)
分享到:
相关推荐
This practical guide shows intermediate and advanced web and mobile app developers how to build highly scalable Java applications in the cloud with Google App Engine. The flagship of Google's Cloud ...
在搭建WebRTC(AppRTC)时,我们会遇到需要部署Google App Engine的难题,并且最近墙的厉害,所以我特地把我珍藏的Google App Engine 最新版(2020-7-5)分享出来,希望可以方便想搭建WebRTC(AppRTC)的同学们
A good book to learn Google App Engine.
clock.rar 这是我今天做的一个基于google app engine写的一个在该平台上开发app的示例,通过该示例的学习,我们可以很快上手学会怎样在GAE上开发属于你的应用程序了,希望对大家有用!
Google App Engine Documentation
云端代码Google App Engine编程指南 人民邮电出版社 高清带书签
云应用开发——Google App Engine & Google Web Toolkit入门指南 Google App Engine入门 Google App Engine 开发人员指南
Eclipse Google 插件 Google App Engine SDK for Java Google App Engine文档 按钮 Google App Engine 开发包
Google App Engine文档
Google App Engine is a web application hosting service. By “web application,” we mean an application or service accessed over the Web, usually with a web browser: storefronts with shopping carts, ...
Google云端的一个重要部分,主要介绍了Google中App Engine的限制。
Using Google App Engine
Google App Engine is a key component of the Google Cloud Platform and one of the most comprehensive cloud services. Together with Python, the first programming language ever supported by the platform,...
Google App Engine 入门教程 eclipse插件 详情请参考我的博客
Google App Engine 入门
Google App Engine for Java 中文指南,Google App Engine for Java 中文指南
appengine-java-sdk-1.3.1 GoogleApp开发的SDK(Java版)
google app engine开发实例,实现了GAE的插入,更改,删除,搜索功能
google app Engine for java中文api,