Here we use a handy Hibernate feature that allows to return a custom object from a JPA query. It will result a List containing for each tag a Map with two attributes: name for the tag name and pound for the tag count.