En HQL :



select m.artworkid,count(n.comment)
from artwork m, comment n
where m.artworkid=n.artworkid
group by m.artworkid
order by count(n.comment) desc