Grails Projections not returning all properties and not grouped
问题 How to get it so i return all of the projections from the below def c = Company.createCriteria() def a = c.list(params){ projections{ property 'id', property 'name' } } if(a.size() == 0) render "404" else { render (contentType: 'text/json'){ totalCount = a.totalCount data = a } } The result comes out like this: {"totalCount":2,"data":["company1","company2"]} Where i need it to be: {"totalCount":2,"data":[{"class":"org.example.Company","id":1,"name":"company1"},{"class":"org.example.Company",