我正在尝试将此JDO查询转换为Objectify查询:
Query query = pm.newQuery(User.class,
"someList.contains(userParam) && someProperty== null");
query.declareParameters("String userParam");
query.setRange(0, 1);
query.execute(user.getId());
这是我的Objectify实现,但我不确定这是否正确:
Query<Question> queryResult = dao.query().filter("someProperty", null)
.filter("someList.contains", user.getId())
.limit(1);
答案 0 :(得分:1)
Objectify就像Java低级API一样。只需在list属性上使用相等过滤器:
Query<Question> queryResult = dao.query(User.class)
.filter("someProperty", null)
.filter("someList", user.getId())
.limit(1);