【发布时间】:2012-12-06 14:55:53
【问题描述】:
使用 Objectify 可以查询对象的子对象。一个对象也可以有一个空父对象。
Parent parent;
List<Children> children = ofy().query(Children.class).ancestor(parent).list();
我想知道的是,如果我可以查询一个 null Parent 吗?所以我想知道所有有一个空父母的孩子。如果我在上面传递 null 我会得到一个异常。
同样使用 null propValue 通过属性创建查询不会返回任何内容。
Query<T> q = ofy().query(clazz);
q.filter(propName, propValue);
return q.list();
【问题讨论】:
标签: google-app-engine objectify