新的release 1.3.1 of GAE已取消 1000 条记录限制:
No more 1000 result limit - That's right: with addition of Cursors and the culmination of many smaller Datastore stability and performance improvements over the last few months, we're now confident enough to remove the maximum result limit altogether.
但是,release notes链接到detail description其中没有提到 JPA,只有 JDO 和低级 API:
In JDO, you can use an extension and the JDOCursorHelper class to use cursors with JDO queries.
未提及 JPA,并且如果 n 大于 1000,我使用 query.setFirstResult(n)
的测试仍然显示相同的错误消息。
java.lang.IllegalArgumentException: offset may not be above
1000
at
com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java: 33)
at
com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall(DatastoreApiHelper.java:
60)
at
com.google.appengine.api.datastore.PreparedQueryImpl.runQuery(PreparedQueryImpl.java:
115) ...
选择计数(*):
我还发现,具有超过 1000 个实例的 select count(*) from MyEntity
返回 1000。
最佳答案
版本 1.3.6 删除了限制:
版本 1.3.6 - 2010 年 8 月 17 日
Results of datastore count() queries and offsets for all datastore queries are no longer capped at 1000.
http://code.google.com/p/googleappengine/wiki/SdkReleaseNotes
关于java - 谷歌应用引擎: 1000 records limit still present with JPA?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2264731/