81,092
社区成员
发帖
与我相关
我的任务
分享
query.setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP).list()
Mybatis的话,好像指定返回类型为Map就OK了!
Map<String,Country> map= new HashMap<String,Country>();
for(Country c: list){
map.put(c.id,c);
}
return map;
伪代码意思就这意思