Is it possible, to query grails with criteria and receive a list of maps instead of a list of lists? I would like to have the column names in the results in order to then work with an 'associative array' rather then numeric array offsets. I currently do something like
def topFiveUsers = BlogEntry.createCriteria().list {
projections {
count('id')
groupProperty('author')
}
maxResults 5
}
Which results in [[123, app.User:1][111, app.User:2][...]...]
, i.e. a list of lists. I would rather want something like [[posts:123, author: app.User:1][posts: 111, author app.User:2][...]...]
.
As always: help is highly appreciated!
groovy.lang.MissingMethodException: No signature of method: grails.gorm.CriteriaBuilder.resultTransformer() is applicable for argument types: (org.hibernate.transform.AliasToEntityMapResultTransformer) values: [org.hibernate.transform.AliasToEntityMapResultTransformer@7a78d380]
– Cabinetmaker