Querying associations in Grails with HQL, Criteria and HibernateCriteriaBuilder
Posted by Erik Pragt mid-morning: June 4, 2008
A thing I was playing with today was many-to-many relationships in Grails to create a Tag Cloud. To create a Tag Cloud, I must have a set of key/value pairs, each with a label and a value of the label, which could look like this:
['Java': 5, 'Grails': 16, 'Groovy': 12]
But to query this, I need to query a many to many relationship and produce the above result. This blog will describe how to do this with HQL, Criteria and the HibernateCriteriaBuilder.
(more...)
Filed under:
1 Comment