Type handler was null on parameter mapping for property '__frch_productId_0'. It was either not spec

来源:互联网 发布:c语言二级证书有用吗 编辑:程序博客网 时间:2024/05/24 06:34

出现如上错误,原因: 在mybatis使用<foreach>标签的时候 , collection 为传入的List item为里面的对象,如果直接对item取值就会出现如此错误。


解决:对item进行取值


------------------------------------------------------


bean : student{id ,name,gender,score}

dao public List<student> getStudentList( List<student> param);注: 这里通过student 的id来查询学生信息

XML:<foreach collection="param" index="index" item="l" open="("
separator="OR" close=")">
id= #{id}错误写法

id=#{l.id}正确写法
    </foreach>

阅读全文
0 0