简体   繁体   English

Google App Engine或带有Objectify的QUERY ID

[英]Google app engine OR QUERY ids with Objectify

Hello I am using objectify with google app engine. 您好,我在Google App Engine中使用objectify。 I've seen that I can do something like this one 我已经看到我可以做这样的事情

List<Car> cars = ofy().load().type(Car.class).filter("year in", yearList).list();

Which achieves an OR QUERY result However when I try to query by id (set as a Long type), I get an exception and that only filtering by Long or String values is allowed. 达到OR查询的结果但是,当我尝试按id(设置为Long类型)查询时,出现异常,并且仅允许按Long或String值进行过滤。 More specific 更加具体

java.lang.IllegalArgumentException: Id filter values must be Long or String

Is it possible to make an OR QUERY by id filtering? 是否可以通过ID过滤来进行OR查询?

When querying multiple ids use .. 查询多个ID时,请使用..

ofy().load().type(Car.class).ids(IDs);

... where IDs is a List of your ids. ...其中ID是您ID的列表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM