专注于 JetBrains IDEA 全家桶,永久激活,教程
持续更新 PyCharm,IDEA,WebStorm,PhpStorm,DataGrip,RubyMine,CLion,AppCode 永久激活教程

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

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

文章永久链接:https://tech.souyunku.com/24351

未经允许不得转载:搜云库技术团队 » mybatis foreach报错It was either not specified and-or could not be found for the javaType Type handler

JetBrains 全家桶,激活、破解、教程

提供 JetBrains 全家桶激活码、注册码、破解补丁下载及详细激活教程,支持 IntelliJ IDEA、PyCharm、WebStorm 等工具的永久激活。无论是破解教程,还是最新激活码,均可免费获得,帮助开发者解决常见激活问题,确保轻松破解并快速使用 JetBrains 软件。获取免费的破解补丁和激活码,快速解决激活难题,全面覆盖 2024/2025 版本!

联系我们联系我们