I am stuck trying to get a query (QueryDSL) to work that gives me a count of distinct categories. For example, what I am trying to achieve:
categoryA -> 10 entries
categoryB -> 20 entries
This is what i have so far:
query().from(application)
.transform(groupBy(application.category).as(list(application)));
However, this gives me for each category a list of all whole entries, I just want to get a count of this.
I tried messing around with count()
but no luck.
Anybody know how to do this?