zoukankan      html  css  js  c++  java
  • mybatis诡异的bug

    在使用mybatis中使用 foreach 时,出现了一个诡异的bug

    java文件中是

    List<ImportTaskInfoEntity> selectByCalcBatchIds(@Param("ids") List<String> ids);

    xml中是

    <foreach collection="ids" index="index" item="item"
    separator="or" open="(" close=")">
    calc_batch_id = #{item}
    </foreach>

    按理,String直接取是ok,但是却取不到。查看异常为

    Type handler was null on parameter mapping for property '__frch_item_0'. It was either not specified and/or could not be found for the javaType (com.xxx.sale.cmis.entity.AuditTaskEntity) : jdbcType (null) combination.

    故猜测,mybatis将集合的元素转化成了 AuditTaskEntity ,故取值改成  calc_batch_id = #{item.calcBatchId} ,居然就通过了。

    实在无解...................

  • 相关阅读:
    Fibonacci Again
    N的10000的阶乘
    HDU2141(二分搜索)
    POJ2366(HASH法)
    10106 Product
    UVA 401 Palindromes
    UVA424 Integer Inquiry
    POJ2503(二分搜索)
    mysql重置root密码
    tidb安装haproxy负载均衡
  • 原文地址:https://www.cnblogs.com/brave-rocker/p/8516744.html
Copyright © 2011-2022 走看看