【发布时间】:2014-05-13 02:48:34
【问题描述】:
我在使用 Objectify 4.0b3/5.02 升级到 GAE SDK 1.9.3/4 时遇到问题
当我使用排序过滤器执行查询并重用它抛出的游标时
"IllegalArgumentException?: Cursor does not match query"
代码如下
QueryResultIterator<FollowJoin> results = ofy().load().type(FollowJoin.class).
filter("followerKey", PositionUser.key(1)).
order("sortIndexFollowing").
limit(1).
startAt(cursor).
iterator();
cursor = results.getCursor();
返回的游标与从原生 DS 查询返回的游标奇怪地不同。
>>>Position {
IndexValue {
property: "sortIndexFollowing"
value <
>
}
key <
app: "test"
path <
Element {
type: "FollowJoin"
name: "USER_10-USER_1"
}
>
>
start_inclusive: false
}
Objectify 光标缺少排序字段
>>>Position {
key <
app: "test"
path <
Element {
type: "FollowJoin"
name: "USER_10-USER_1"
}
>
>
start_inclusive: false
}
此确切代码适用于 SDK 1.9.2。
但使用 GAE SDK 1.9.3、1.9.4 失败。
显然我的查询使用了订单参数,但光标不包含订单字段。
它似乎仅限于开发环境,并没有出现在生产环境中。 这会导致在 dev 上的测试出现问题。
导致行为改变的原因是什么?
谢谢
-lp
【问题讨论】:
标签: google-app-engine objectify