Using GROUP BY in JPA

I have an @ManyToMany relationship between a Question object and a Category object. I want to calculate the number of questions in each category. How can I do it?

+7
source share
1 answer
select count(question.id), category.description from Category category left join category.questions question group by category.description 
+9
source

All Articles