SQLException: Invalid parameter object type. Expected 'java.util.ArrayList' but found 'java.util.Ar

来源:互联网 发布:数据挖掘 股票预测 编辑:程序博客网 时间:2024/06/09 13:03

DAO中是参数类型是List,xml中的参数类型是ArrayList,需要把xml中的参数类型修改为List

Cause: java.sql.SQLException: Invalid parameter object type.  Expected 'java.util.ArrayList' but found 'java.util.Arrays$ArrayList'.; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:

修改后:

    //DAO    public List<T1> queryListByErps(List<String> erps) {        LOG.info("进入 queryListByErps 方法 ");        return super.getSqlMapClientTemplate().queryForList("T1.queryListByErps", erps);    }    <!--xml中,根据erp查询多条记录 -->    <select id="queryListByErps" parameterClass="java.util.ArrayList" resultMap="BaseResultMap">        select * from t1 where  1=1 and erp in        <iterate  open="(" close=")" conjunction=",">            #[]#        </iterate>    </select>

T1类中不需要有erps属性



















原创粉丝点击