I am having the same problems of how to do this. However, I do not like Jason's solution because it seems as if I would get the book data back even if I wanted the author data only.
On Jan 12, 5:58 pm, "Jason (Google)" <[email protected]> wrote: > If you're using JDO, then just as Juan said, you can fetch the author's > books when you fetch the author entities themselves. Just make sure to > specify that the books field is in the default fetch group: > > @Persistent(defaultFetchGroup = "true") > private List<Book> books; > > //... > > public List<Book> getBooks() { > return books; > > } > > - Jason > > On Mon, Jan 11, 2010 at 12:53 PM, Juan <[email protected]> wrote: > > Are you using JDO/JPA? or querying thru GQL? > > > in the first case, make sure you eager fetch de book collection when > > retrieving the object form DB. second case... just follow Bert´s > > suggestion > > > On Jan 10, 7:40 pm, fhucho <[email protected]> wrote: > > > Hi, sorry for beginner question. I have authors and books in the > > > database. Every author has list of books in a one to many owned > > > relationship. I know the author's name, how can I retrieve the author > > > and his books from database? I know how to get the author but not his > > > books (Author.books). > > > -- > > 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]<google-appengine-java%[email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/google-appengine-java?hl=en. > >
-- 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.
