I’m wondering if grails createCriteria supports group by multiple attributes like pure sql does. I’d like to list entries like this:
def criteria = DomainClass.createCriteria()
def results = criteria.list {
groupProperty('parameterA')
groupProperty('parameterB')
}
This will list just entries with unique parameterA and parameterB combination. The problem is that this doesn’t work, is there any solution or should I use hsql or something simmilar?
Thanks,
Mateo
You could try HQL. Remember that Criterias are actually builders, so they will always be only a subset of HQL, in which you can add as many properties as you want in your group by.