首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

关于Sqlmap中传list参数的用法!求解!

2012-04-10 
关于Sqlmap中传list参数的用法!!!在线等求解!!!!------------------------------JSP中:%List listTSGUti

关于Sqlmap中传list参数的用法!!!在线等求解!!!!
------------------------------JSP中:

 <%

 List list=TSGUtils.queryRoleCode2(userid); // 此时已得到值:[KSLD,BMLD,JSSLD]

%> 


<A class=tdblack href="${ctx}/SpesDispatchAction.do? efFormEname=TSGBook012&serviceName=VLTSGReviewHis&methodName=list&i-0-enables=1&i-0-reviewerRoleList="+<%=list%> target="mainFrame">审批管理</A>

-----------------------------queryRoleCode2 方法为:
/**
* 根据usercode查出roleCole
* @param usercode
* @return
*/
public static List queryRoleCode2(String usercode){
TSGRoleDao roleDao= (TSGRoleDao)BeanContext.getBean("daoTSGRole");
Map map = new HashMap();
map.put("userNo", usercode);
List list=roleDao.queryRoleCode(map);
List list2=new ArrayList();
for (int i = 0; i < list.size(); i++) {
list2.add(((Map)list.get(i)).get("ROLE_CODE").toString());
}
return list2!=null&&list2.size()>0?list2:null;
}





------------------sqlMap中:

<select id="queryVL" parameterClass="hashmap" resultClass="hashmap">
select 
REVIEW_ID as "reviewId"
FROM T_TSG_REVIEWHIS
where ENABLES='1'
<dynamic prepend=" AND ">
<isNotEmpty prepend=" AND " property="reviewId">REVIEW_ID like '%'||#reviewId#||'%'</isNotEmpty>  
<isNotNull property="reviewerRoleList" prepend=" and " >
REVIEWER_ROLE in
<iterate property="reviewerRoleList" conjunction="," open="(" close=")">#reviewerRoleList[]# </iterate>
</isNotNull>
</dynamic>
</select>


---------------报错:
com.ibatis.sqlmap.client.SqlMapException:ParameterObject or property was not a Collection, Array or Iterator.
后面省略。


应该传什么值呢?在线求解!!!!!



[解决办法]
检查你reviewerRoleList传进去了个什么

热点排行