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(USER_TO_ROLE.ROLE_ID))
.where(USER.U_EMAIL.equal(email))
.fetchGroups(
r -> r.into(USER).into(UserPojo.class),
r -> r.into(ROLE).into(RolePojo.class)
);
Please note that if you want to use it instead LEFT JOIN(in case the user does not necessarily have any roles and you want to get an empty list for each user), you will have to translate the roles NULLinto empty lists yourself.
, equals() hashCode() POJO, HashMap :
<pojosEqualsAndHashCode>true</pojosEqualsAndHashCode>