0
를 참조 자 검색 할 때 나는 두 Objectify entities
이 참조 된 개체를 얻을 수 없습니다 Object
& Category
를, 각 Object
는 특정 Category
이다. 그래서, 엔티티 Object
Category
개체에 대한 참조 (Ref
)에 추가했지만 내 문제는 내가 datastore
에서 Object
를 검색 할 때 나는 Ref
선언에 @Load
주석을 추가하고 있지만, 그이 Category
가 검색되지 않는 것입니다.Google 앱 엔진은 엔티티
Object
기업의 Category
게터 & 세터는 다음과 같습니다
List<Object> objects = ofy().load().type(Object.class).list();
그리고 Category
를 검색 할 수있는 명령은 다음과 같습니다 :
@Load Ref<Category> category;
public Category getCategory() {
return category.get();
}
public void setCategory(Category category) {
this.category = Ref.create(category);
}
객체를 검색하는 데 사용되는 쿼리는
for (Object object : objects)
object.getCategory().getName();