Try setting a different JdbcType for this parameter or a different configuration property. Cause: org.postgresql.util.PSQLException: 欄位索引超過許可范圍:2,欄位數:1


執行mybaits sql

    <delete id="delete4BatchesByLineCi" parameterType="java.util.List">
        <foreach collection="list" item="item" index="index" separator=";">
--             update VPN_FIREWALL set is_delete = true where where LINE_CI = #{item}
            delete from VPN_FIREWALL where LINE_CI = #{item, jdbcType=VARCHAR}
        </foreach>
    </delete>

提示錯誤:
 org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: 
 Could not set parameters for mapping: ParameterMapping{property='__frch_item_0', mode=IN, javaType=class java.lang.String, jdbcType=VARCHAR, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. 
 Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #2 with JdbcType VARCHAR . 
 Try setting a different JdbcType for this parameter or a different configuration property.
 Cause: org.postgresql.util.PSQLException: 欄位索引超過許可范圍:2,欄位數:1。\

根據網上類似問題解決方案,都不能解決此問題,對比在另一處 這種用法沒有問題,刪除注釋行 ,問題解決。

--update VPN_FIREWALL set is_delete = true where where LINE_CI = #{item}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM