grails查询指定列,且以map的形式返回结果集,有两种方式:
1、select new map(id as id,name as name) from User
2、User.createCriteria().list{
projections{
property("id","aliasId")
property("name","aliasName")
}
setResultTransformer(CriteriaSpecification.ALIAS_TO_ENTITY_MAP)
}