mybatis批量插入報錯“Parameter '__frch_item_0' not found. Available parameters are [list]”
原sql:
<select id="queryList" parameterType="java.util.List" > insert into table1(column1,column2,column3,column4,column5) ( <foreach collection="list" index="index" item="item" separator="union all" > select #{item.column1}, #{item.column2}, #{item.column3}, #{item.column4}, #{item.column5} from dual </foreach> ) </select>
主要分析兩點可能的原因:
1、檢查傳的引數是否是list,parameterType是否為java.util.List。
2、檢查foreach遍歷的item是否有為空的引數,我遇到的就是這種情況導致的。
相關推薦
mybatis批量插入報錯“Parameter '__frch_item_0' not found. Available parameters are [list]”
原sql: <select id="queryList" parameterType="java.util.List" > insert into table1(column1,column2,column3,column4,column5)
MyBatis 報錯Parameter 'mobile' not found. Available parameters are [arg1, arg0, param1, param2]解決方案
一、場景簡述 筆者使用MyBatis 3.x的時候使用如下介面 @Mapper public interface UserMapper { @Select("select id,mobile,password from news_user where mobil
mybatis 批量增加 Parameter '__frch_item_0' not found. Available parameters are [list]
當在mybatis用到foreach的時候,會報這個錯誤Parameter '__frch_item_0' not found. Available parameters are [list]會出現的
解決Parameter '__frch_item_0' not found. Available parameters are [list]
業務場景:使用mysql+mybatis進行批量插入時報出如下錯誤:org.mybatis.spring.MyBatisSystemException: nested exception is org.
Parameter '__frch_item_0' not found. Available parameters are [list]
mybatis 批量插入,報這個錯誤,查詢資料,無法解決。仔細檢視sql語句,原來語句寫錯了,我傳的是List<Integer>型,所以,foreach 的時候,直接#{item},即可 insert into dept_impr
Parameter 'list1' not found. Available parameters are [list] 解析
在使用foreach語句時會經常報Parameter ‘ordersList’ not found. Available parameters are [list] 解析這個錯誤,造成這個錯誤的主要原因你的寫法錯誤:請看錯誤例項 mapper介面中 List
Parameter 'list1' not found. Available parameters are [list, collection]
注意:你可以傳遞一個 List 例項或者陣列作為引數物件傳給MyBatis。當你這麼做的時候,MyBatis會自動將它包裝在一個Map中,用名稱在作為鍵。List例項將會以“list”作為鍵,而陣列例項
mybatis批量插入報錯“Parameter '__frch_item_0' not found. Available parameters are [list]”
原sql: <select id="queryList" parameterType="java.util.List" > insert into table1(column1,column2,column3,column4,column5) ( <f
mybatis 批量插入list集合 Parameter 'interacId' not found. Available parameters are [list, collection]報錯
關鍵點在標註的位置: 引數型別 collection為list list並不是你傳入的引數的變數名,我傳入的變數名為lists 直接寫成 list即可; 不要使用那個原生的 if(
SpringBoot整合Mybatis註解版---update出現org.apache.ibatis.binding.BindingException: Parameter 'XXX' not found. Available parameters are
SpringBoot整合Mybatis註解版---update時出現的問題 問題描述: 1、sql建表語句 DROP TABLE IF EXISTS `department`; CREATE TABLE `department` ( `id` int(11) NOT NULL AUTO_INCREMEN
錯誤:Parameter '__frch_item_0' not found. Available parameters are [list]
報錯資訊 org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter '__frch_item_0' not
mybatis. Parameter 'xxxList' not found. Available parameters are [c
今天遇到遇到一個myabitis 批量Insert時報出的 Parameter ‘promotionActivityRuleList’ not found. Available parameters are [collection, list] org.ap
Parameter 'idList' not found. Available parameters are [collection, list]
今天遇到一個這樣的問題,寫在這裡作為一個記錄,方便以後檢視, 遇到這個錯誤首先檢查所有的型別是不是都是List, 第二,在Mapper.java使用list需要有@parm註解一同使用(我就是因為沒有寫這個註解報錯)
Parameter 'xx' not found. Available parameters are [0, 1, 2, 3, param3, param4, param1, param2]
報錯描述: 2017-03-30 16:37:11,177 ERROR [500.jsp] - nested exception is org.apache.ibatis.binding.BindingException: Parameter 'userId' not f
MyBatis3錯誤:Parameter 'id' not found. Available parameters are [arg2, arg1, arg0, param3, param1, par
這個問題涉及到MyBatis3在使用select節點查詢時傳遞多個引數的問題。問題分析如下: 1、如果是單個查詢一般是這樣配置: <select id="getUserArticles" parameterType="int" resultM
Mybatis報錯:Parameter 'list' not found. Available parameters are [groupList, param1]
ber goods values tor 我們 問題 util 沒有 nbsp GroupDao.java 裏面定義的方法: void batchInsertLog(@Param("groupList") List<MktPromotionIntegralLog>
解決Oracle+Mybatis批量插入報錯:SQL 命令未正確結束
每次 rom list ins 配置文件 解決 報錯 文件 什麽 Mybatis批量插入需要foreach元素。foreach元素有以下主要屬性: (1)item:集合中每一個元素進行叠代時的別名。 (2)index:指定一個名字,用於表示在叠代過程中,每次叠代到的位置。
zbb20171215 MyBatis報錯: Parameter '*' not found. Available parameters are [1, 0, param1, param2]
class adding data alt num sql throws clas str mapper代理接口中的方法: public User login(String loginid,String loginpwd) throws Exception; mapp
MyBatis 報錯Parameter 'mobile' not found. Available parameters are [arg1, arg0, param1, param2]解決方案
一、場景簡述 筆者使用MyBatis 3.x的時候使用如下介面 @Mapper public interface UserMapper { @Select("select id,mobile,password from news_user where mobile = #{mo
mybatis批量插入報錯:','附近有錯誤
mybatis批量插入的時候報錯,報錯資訊‘,’附近有錯誤 mapper.xml的寫法為 <insert id="insertByBatch"> INSERT INTO USER_LOG (USER_ID, OP_TYPE