gkatzioura gkatzioura - 1 month ago 9
Java Question

Google app engine OR QUERY ids with Objectify

Hello I am using objectify with google app engine.
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.
More specific

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


Is it possible to make an OR QUERY by id filtering?

Answer

When querying multiple ids use ..

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

... where IDs is a List of your ids.