java - 谷歌应用引擎: 1000 records limit still present with JPA?

标签 java google-app-engine jpa

新的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/

相关文章:

google-app-engine - 使用 google Oauth 2.0 进行身份验证与已注册的重定向 URI 不匹配

java - 使用 JPA 进行更新的最佳方法

java - 当 pageable.size = 1 时,具有可分页、连接表的 JPA 存储库 nativeQuery 不起作用

java - Mockito 默认行为和具有相同返回类型的方法的自定义行为

python - 谷歌 NDB : Adding an entity with non existing parent

java - 在JAVA spring mvc中查找两个数组列表的差异

python - Google App Engine Python Webapp2 301 从 www 重定向到非 www 域

hibernate - 如何为连接表自动生成 GUID?

java - 如何在 Android fragment 和服务中请求注入(inject)?

java - 返回多个泛型类时未经检查的转换