I found the answer myself. This can be done using the conversion function in queryDSL.
From http://www.querydsl.com/static/querydsl/3.4.3/reference/html/ch03s02.html Section 3.2.4
Map<Integer, List<Comment>> results = query.from(post, comment)
.where(comment.post.id.eq(post.id))
.transform(groupBy(post.id).as(list(comment)));
So, for example, if you want to group by 2 columns, the following code will work:
Map<List<?>, List<Comment>> results = query.from(post, comment)
.where(comment.post.id.eq(post.id))
.transform(groupBy(post.id, post.hooplah).as(list(comment)));
which creates the map List_of_groupByFieldValues -> List_of_results.
- , concat queryDSL?