ibaits2中要注意remapResults-被坑了

来源:互联网 发布:arora浏览器 windows 编辑:程序博客网 时间:2024/05/16 12:57
在ibatis2中,要注意动态列,动态表是可以使用的,比如: 

select $filelist from assetlocationmapping where $colname$ = #colvalue# 

然后 

Map deleteinAssetLocationMapping=new HashMap(); 
deleteinAssetLocationMapping.put("colname",colname); 
deleteinAssetLocationMapping.put("colvalue",colvalue) 
就是传一个MAP进去,就可以实现动态列了,但要注意,在配置文件中, 
要加上: 
<select id="selectBySql" resultClass="java.util.HashMap" 
remapResults="true">中的remapResults="true",默认为FALSE
0 0