I am trying to execute the below query using Objectify 5.1.8 :-
Query<Coupon> coupons = ObjectifyService.ofy().load().type(Coupon.class).filter("rewardPoints !=", "").project("code").distinct(true);
for (Coupon coupon : coupons) {
out.write(coupon.getCode());
}
It is giving me an error :
java.lang.IllegalArgumentException: Inequality filter on rewardPoints must also be a group by property when group by properties are set.
Basically, what I wish to achieve is to perform a filter and project query alongside the distinct query on an entity.
Please let me know if there is something wrong with the query.
Note: rewardPoints is Indexed.