或许是惯性思维,在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接口

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

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

 <if test="flowStepCodeList != null and flowStepCodeList.size() > 0">
fh.flow_step_code in
<foreach collection="flowStepCodeList" item="flowStep" index="index" open="(" close=")" separator=",">
#{flowStep.flowStepCode}
</foreach>
</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. IEnumerable对象的Distinct方法重写

    public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource ...

  2. python写注册

    # coding = UTF-8 注释格式 import datetime 引用日期 today = datetime.datetime.today().strftime("%Y-%m-%d ...

  3. git 提交代码操作

    1.修改1分支后 git add git commint2.切换到本地分支git checkout local-5.0git remote update 更新远程仓库3.git pull origin ...

  4. CommonsChunkPlugin VS SplitChunksPlugin

    等了好久终于等到你, webpack团队人员卧薪尝胆五个多月的时间终于带来的webpack4.0,个人觉得webpack4带来的最大优化便是对于懒加载块拆分的优化,删除了CommonsChunkPlu ...

  5. session实现原理(阿里面试题)

    问: 当用户登录某网站后,向服务器发送一个请求,服务器如何判断是这个用户请求的 首先,你要明白一点,最初http协议在设计的时候,主要面向当时的web1.0网站,他们不需要知道是谁来访问,只需要向外界 ...

  6. ELK的文档搭建

    一.安装elasticsearch 官网:https://www.elastic.co/guide/index.html https://www.elastic.co/guide/en/elastic ...

  7. HTTP Status 404 – Not Found

    一般都是配置中的问题,这次发现扫描controller时,自己的包是com.aaa.conlller,而springmvc.xml中扫描的是com.aaa.controller,,多写了一个l

  8. 2019.03.28 bzoj3595: [Scoi2014]方伯伯的Oj(splay+map+set)

    传送门 题意简述: 给一个有优先级的nnn个人的序列,初始的时候第iii个人排名为iii,现在有mmm个操作,种类如下: 把编号为xxx的改成yyy,输出改前xxx的排名 把编号为xxx放到队首,输出 ...

  9. Git合并指定一系列commits到另一个分支

    Git合并指定文件到另一个分支经常被问到如何从一个分支合并特定的文件到另一个分支.其实,只合并你需要的那些commits,不需要的commits就不合并进去了. 合并某个分支上的单个commit首先, ...

  10. Python开发——10.面向对象编程进阶

    一.isinstance(obj,cls)和issubclass(sub,super) 1.isinstance(obj,cls) 判断obj是不是由cls产生的类 2.issubclass(sub, ...