jOOQ can I fetch a join of two tables into the respective POJOs
In jOOQ if I want to fetch a row of a table into a jOOQ autogenerated POJOs I do, for instance: dsl.selectFrom(USER) .where(USER.U_EMAIL.equal(email)) .fetchOptionalInto(User.class); Now, suppose that I want to do a join between two tables, e.g. USER and ROLE , how can I fetch the result into the POJOs for these two tables? This is one solution using ResultQuery.fetchGroups(RecordMapper, RecordMapper) Map<UserPojo, List<RolePojo>> result = dsl.select(USER.fields()) .select(ROLE.fields()) .from(USER) .join(USER_TO_ROLE).on(USER.USER_ID.eq(USER_TO_ROLE.USER_ID)) .join(ROLE).on(ROLE.ROLE_ID.eq