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 <j...@irungaray.com.ar> 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 <fhu...@gmail.com> 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
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@googlegroups.com>
> .
> 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 google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to