Hi, this question should be posted in the Objectify group and not in this one.
It works in A for B because A is a parent of B so you can search with for B instances having an A instance as ancestor. For the others, it doesn't work: an A is not ancestor of a C so it can't work. It could work for Cs having Bs as ancestors but it may be null if no existing C entity has the B you give as parent. regards didier On May 10, 2:05 pm, pavb <[email protected]> wrote: > Hi > > I am using objectify in my appengine application and I have problems > with my ancestor queries > My model is designed as follow: > > class A { > public B getB() { > return Ofy.getOfy().get().query(B.class).ancestor(this).get(); > } > > public C getC() { > return Ofy.getOfy().get().query(C.class).ancestor(this).get(); > > } > } > > class B { > @Parent > private A a; > > public C getC() { > return Ofy.getOfy().get().query(C.class).ancestor(this).get(); > } > > } > > class C { > @Parent > private B b; > > } > > Only the getB() method of the class A works and returns the entity B. > All the others return null and I don't understand why? > > Could you help me please? > > Thanks > > PA -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
