标签:grails查询指定列
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)
}
标签:grails查询指定列
原文地址:http://blog.51cto.com/gz521/2054840