I felt it appropriate to discuss with you the following idea:

 We have the following Java classes (getters and setters are ommitted):

         class Person {
                 Integer id;
                 String name;
                 Byte sexId;
                 Date birthDate;
                 Person couple;
                 List<Person children;
         }

         class Home {
                 Integer id;
                 String address;
         }

 And we have the following SQL query:

         select
                 PERSON.id,
                 PERSON.name
                 PERSON.sex_id as 'sexId',
                 COUPLE.name as 'couple.name',
                 COUPLE.sex_id as 'couple.sexId',
                 HOME.id as 'couple.home.id',
                 HOME.address as 'couple.home.address',
                 CHILDREN.id as 'children[].id',
                 CHILDREN.name as 'children[].name'
         from
                 Person PERSON
                         left outer join
                 Person COUPLE
                         on COUPLE.id = PERSON.couple_id
                         left outer join
                 Home HOME
                         on HOME.id = COUPLE.home_id
                         left outer join
                 Person_children PC
                         on PC.person_id = PERSON.id
                         inner join
                 Person CHILDREN
                         on CHILDREN.id = PC.son_id
         where
                 PERSON.sex_id <> COUPLE.sex_id and
                 (PERSON.birth_date between ? and ?) and
                 (COUPLE.birth_date between ? and ?)
         order by
                 PERSON.id asc

 It would be nice that JOOQ to have a mechanism to take that query,
 issue it against the database, traverse the JDBC ResultSet, and
 create and populate a Java object tree thanks to the column alias.

 Thanks in advance.

-- 
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/groups/opt_out.


Reply via email to