【发布时间】:2016-06-21 19:39:19
【问题描述】:
我正在尝试基于实体的@id 属性在App Engine 中进行查询,但我不断收到此错误
java.lang.IllegalArgumentException: __ key __ filter value must be a Key
这就是我的查询方式
Filter f1 = new FilterPredicate("personId", FilterOperator.EQUAL,personId);
Filter f2 = new FilterPredicate(Entity.KEY_RESERVED_PROPERTY, FilterOperator.GREATER_THAN,newestCommentId);
Filter filter = CompositeFilterOperator.and(f1,f2);
Query<Record> query = ofy().load().type(Record.class).filter(filter)
.limit(limit).order("-"+ Entity.KEY_RESERVED_PROPERTY);
我想获取所有> 发送到应用引擎方法的最后评论 id
实体中的id字段是这个
@Id
Long id;
我首先尝试使用id,但随后我收到一条错误消息,提示您不能使用具有@id 的文件,也许我的意思是__ 键__
那么我该如何执行这个查询呢?
【问题讨论】:
标签: google-app-engine google-cloud-platform objectify google-cloud-datastore