Hi

While you can get a List<Author> easily from jOOQ via DefaultRecordMapper
and the API documented here:
http://www.jooq.org/doc/latest/manual/sql-execution/fetching/pojos/

... jOOQ will not map your List<Book> or any other sort of to-many
relationship for you.

The most recent, thorough explanation was given here:
https://groups.google.com/d/msg/jooq-user/cLsMamqMUYc/MPgaZcJwTSgJ

2015-04-05 20:54 GMT+02:00 <[email protected]>:

> Hi!
>
> Let's say I'm building a library application with jOOQ. I have an
> "authors" table and a "books" table. "Authors" table has fields "id" and
> "name", while "books" has "id", "name" and "author_id", which refers to a
> record in the "authors" table. I want to retrieve all the autors from the
> database and map the result to a List<Author>.
> public class Author {
>     private int id;
>     private String name;
>     private List<Book> books;
>     // Getters, setters
> }
>
> public class Book {
>     private int id;
>     private String name;
> }
>
>  --
> You received this message because you are subscribed to the Google Groups
> "jOOQ User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to