1
엔티티로 저장하는 ObjectS 클래스가 있습니다. 이 ObjectS에서는 ObjectP를 다음과 같은 방법으로 부모로 선언합니다. 내가 websafeObjectPKey과 함께합니다 (API 탐색기에서 다른 API를 사용하여) 엔티티 객체를 생성 할 때, 나는 지역에서 엔티티를 볼 수 있습니다Objectify 쿼리가 조상과 작동하지 않습니다.
@ApiMethod(
name = "getObjectPChildren",
path = "getObjectPChildren",
httpMethod = HttpMethod.POST
)
public Collection<ObjectS> getObjectPChildren(@Named("websafeObjectPKey") final String websafeObjectPKey)
{
Key<ObjectP> objectPKey = Key.create(websafeObjectPKey);
Query<ObjectS> q = ofy().load().type(ObjectS.class)
.ancestor(objectPKey);
return q.list();
}
@Parent
@ApiResourceProperty(ignored = AnnotationBoolean.TRUE)
private Key<ObjectP> objectPKey;
그런 다음 내 API는 다음과 같습니다 데이터 저장소. 그러나, 위의 쿼리는 내가 다음
는 데이터 저장소에있는 모든 개체를 반환하지Query<ObjectS> q = ofy().load().type(ObjectS.class);
에 쿼리를 수정하는 경우에는 엔티티, 흥미롭게. :-(없다 말한다 비어있는 의미를 반환! 이것은 데이터 저장소를 의미