Try setting a different JdbcType for this parameter or a different configuration property. Cause...

Easter79
• 阅读 692

执行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}
点赞
收藏
评论区
推荐文章
郜小超 郜小超
3年前
实际开发过程中遇到的js方法
1.递归方法实现树形结构formatCompanyTree(data,id){constnewDatadata.filter(itemitem.pidid).map(item({...item,disabled:item.nodetype
Easter79 Easter79
2年前
vue 中使用vant
html<!TODO这是上传多张图<divclass"vercodebottomonerightcode"<divclass"postinguploaderitem"vfor"(item,index)inpostData":key"index"
Easter79 Easter79
2年前
vue 自定义步骤条组件(css)
话不多说直接上组件代码。。<template<div<ulclass"steps"<livfor"(item,index)inSetData":key"itemindex":class"{'a
Easter79 Easter79
2年前
vue input复选框checkbox默认样式纯css修改
<divclass"data_list"vfor"(item,index)indata_list":key"index"<inputtype"checkbox"class"check_boxtuicheckbox":id"'id'item.id":value"item.id"vmodel
Wesley13 Wesley13
2年前
mybatis执行批量更新batch update 的方法(oracle,mysql)
介绍oracle和mysql数据库的批量update在mybatis中配置不太一样:oracle数据库:\codesyntaxlang"java"\updateid"batchUpdate"parameterType"java.util.List"<foreachcollection"list"item
Stella981 Stella981
2年前
Electron 渲染进程与渲染进程之间的实时通信 (实时触发及接收消息)
1、首先在渲染进程A里面获取到所有的窗口id信息,然后给所有的窗口发送事件remote.webContents.getAllWebContents().forEach((item,index){2、在所需要接收内容的渲染进程里面,通过ipcRenderer.on兼容,即可实时收到消息ipcRe
Stella981 Stella981
2年前
Mybatisd对MySQL批量插入、批量更新及批量删除语句
1、批量插入<insertid"insertBatch"parameterType"java.util.List"insertintot_student(name,age,class)values<forea
Stella981 Stella981
2年前
JavaScript splice() 方法和JavaScript split() 方法
定义和用法splice()方法向/从数组中添加/删除项目,然后返回被删除的项目。注释:该方法会改变原始数组。语法arrayObject.splice(index,howmany,item1,.....,itemX)参数描述index必需。整数,规定添加/删除项目的位置,使用负数可从数组结尾处规定位
Wesley13 Wesley13
2年前
Mysql批量插入更新
批量插入,使用MyBatis批量语法:<insertid"insertBatch"parameterType"list"insertintotbl1(a,b,c)values<foreachcollection"list"item"obj"separator",
Wesley13 Wesley13
2年前
vant 底部导航组件的实现(tabbar)
简单设计一个底部导航的功能组件1.路由跳转2.选项卡的原理3.路由拦截<template<vantabbarvmodel"active"class"active_tab"<vantabbaritemvfor"(item,index)intabbars"
Easter79
Easter79
Lv1
今生可爱与温柔,每一样都不能少。
文章
2.8k
粉丝
5
获赞
1.2k