或许是惯性思维,在mybatis使用foreach循环调用的时候,很多时候都是传一个对象,传一个List的情况很少,所以写代码有时候会不注意就用惯性思维方法做了。

今天向sql传参,传了一个List作为参数,然后在xml里再foreach循环调用。然后报错信息如:

mybatis foreach报错It was either not specified and/or could not be found for the javaType

Type handler was null on parameter mapping for property '__flowStepCode_0

Mapper接口

  1. List<AllocationHandlerInfoVo> listAllocatedHandlerInfo(@Param("flowStepCodeList")List<ApprStepModel> flowStepCodeList);

原来是这样:#{flowStep},处理方法,换成#{flowStep.flowStepCode},List是个集合来的,要注意,写博客记录

  1. <if test="flowStepCodeList != null and flowStepCodeList.size() > 0">
  2. fh.flow_step_code in
  3. <foreach collection="flowStepCodeList" item="flowStep" index="index" open="(" close=")" separator=",">
  4. #{flowStep.flowStepCode}
  5. </foreach>
  6. </if>

mybatis foreach报错It was either not specified and/or could not be found for the javaType Type handler的更多相关文章

  1. spring 整合Mybatis 《报错集合,总结更新》

    错误:java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldExcepti ...

  2. JSP标签c:forEach报错(一)

    1.jsp标签c:forEach报错,具体错误如下: 三月 31, 2014 9:31:14 下午 org.apache.catalina.core.StandardWrapperValve invo ...

  3. Mybatis数据库连接报错:对实体 "characterEncoding" 的引用必须以 ';' 分隔符结尾

    Mybatis数据库连接报错:对实体 "characterEncoding" 的引用必须以 ';' 分隔符结尾 ============================== 蕃薯耀 ...

  4. 【mybatis】mybatis访问报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 或者 feign被调用方使用的mybatis总报空指针异常java.lang.NullPointerException,而变量都没有问题的情况

    mybatis访问报错:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 需要检查的步骤: ...

  5. 【Mybatis】mybatis查询报错org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'areaName' in 'class java.lang.String'

    mybatis查询报错: Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for pro ...

  6. myBatis查询报错 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near

    myBatis查询报错 You have an error in your SQL syntax; check the manual that corresponds to your MySQL se ...

  7. MyBatis批量操作报错:Parameter 'xxxList' not found. Available parameters are [list]

    问题背景: 在Dao中使用MyBatis进行查询操作,参数是传的一个List:studentNameList,但是在执行查询的时候报错,具体日志如下: com.chenzhou.base.mybati ...

  8. 【JSP jstl c标签】使用c:foreach 报错(警告)”test does not support runtime expressions“

    后台封装的数据是个list,传递给前台,显示如下: <c:forEach items="${userInfo}" var="user"> 用户Nam ...

  9. Spring+Mybatis整合报错Mapped Statements collection does not contain value原因之一

    报错如下: ### Error updating database. Cause: java.lang.IllegalArgumentException: Mapped Statements coll ...

随机推荐

  1. Go 学习

    学习Golang,可以在线实践:https://www.tutorialspoint.com/go/index.htm

  2. css三列布局之双飞翼pk圣杯

    三列布局:两边定宽,中间自适应! 看到这个问题,我第一眼想的就是两边定宽float左右,中间加一个margin宽度自适应或者直接设一个overflow:hidden触发bfc机制,这样也可以,看上去也 ...

  3. JS学习记录------JS基本指令

    对未来的恐慌,和想成为一名自由开发的梦想.让我觉得应该点亮一个新的技能:WEB前端开发. 重新学习JS以及jQuery,让我在日常code的过程中可以更得心应手,毕竟,我爱代码. 这篇文章主要记录的内 ...

  4. Posche Piwis 3 Original and Clone – What’s the difference

    Category : Car Diagnostic Tools What’s the difference between Porsche Tester Piwis III original and ...

  5. HDU2035

    #include <bits/stdc++.h> using namespace std; int fastpow(int a,int b,int k) { ; while(b) { ) ...

  6. eclipse Maven Dependencies 黑色背景说明

    记录工作点点滴滴,大到系统设计,源码分析,小到IDE设置. 这里要说的是eclipse中Maven Dependencies 为什么有些jar用黑色背景,如下图所示: 网上很多人说jar包在本地仓库不 ...

  7. centos 7.3 安装配置python3.6.1

    1.先安装一些我遇到的依赖问题(如果有依赖问题按提示安装): yum install xz gcc zlib zlib-devel 2.官网下载源码包 地址:https://www.python.or ...

  8. idea启动springboot+jsp项目出现404

    场景:用IntelliJ IDEA 启动 springBoot项目访问出现404,很皮,因为我用eclipse开发时都是正常的,找了很久,什么加注释掉<scope>provided< ...

  9. 02.02.01 第1章 简介及基础操作(Power BI商业智能分析)

    02.02.01.01 powerbi简介 00:10:59 02.02.01.02 query数据导入 00:03:26 具体操作实例如下: 02.02.01.03导入access数据 00:05: ...

  10. Promise实战AJAX封装

    一.利用Promise的知识,对最开始的ajax的例子进行一个简单的封装: var url = 'xxx'; // 封装一个get请求的方法 function request(url){ return ...