解决Parameter '__frch_item_0' not found. Available parameters 问题

  1. 问题描述:

    出现如下问题,执行报错信息

Caused by: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘__frch_item_0‘ not found. Available parameters are [list, param1]
	at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:75) ~[mybatis-spring-1.2.2.jar:1.2.2]
	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:371) ~[mybatis-spring-1.2.2.jar:1.2.2]
	at com.sun.proxy.$Proxy21.insert(Unknown Source) ~[na:na]
	at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:240) ~[mybatis-spring-1.2.2.jar:1.2.2]
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:51) ~[mybatis-3.2.8.jar:3.2.8]
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52) ~[mybatis-3.2.8.jar:3.2.8]
	at com.sun.proxy.$Proxy36.bashInsert(Unknown Source) ~[na:na]
	at

  2. 查询问题

    1. 检查报错方法体内,是否采用了@Param注解import org.apache.ibatis.annotations.Param;

    

    int bashInsert(@Param("list") List<Demo> list);

  

    2. 检查在<foreach>标签中的collection属性中是否与list一致

    

    <foreach collection="winReportMonthDpds" item="item" separator=",">

    3. 检查forEach中的item中所修饰的Demo的字段是否进行改变,也就是这是否是你之前编写的代码,但是你更新了po类中的update_time字段,但是在你的mapper中foreach的时候并没有进行修改

3. 解决问题

    1. 进过查看,发现由第三个问题导致,由于之前修改了PO类中的update_time改为了updated_time ,导致其出现问题。问题解决

解决Parameter '__frch_item_0' not found. Available parameters 问题

原文地址:https://www.cnblogs.com/lonecloud/p/10021110.html

时间: 2024-10-09 02:08:21

解决Parameter '__frch_item_0' not found. Available parameters 问题的相关文章

解决Parameter &#39;offset&#39; not found. Available parameters are [0, 1, param1, param2]的方法

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'offset' not found. Available parameters are [0, 1, param1, param2] at org.mybatis.spring.MyBatisExceptionTranslator.translateExcepti

解决mybatis foreach 错误: Parameter &#39;__frch_item_0&#39; not found

解决mybatis foreach 错误: Parameter '__frch_item_0' not found 在遍历对象的属性(是ArrayList对象)时报错: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter '__frch_item_0' not found. Available parameters

Mybatis报错:Parameter &#39;list&#39; not found. Available parameters are [groupList, param1]

GroupDao.java 里面定义的方法: void batchInsertLog(@Param("groupList") List<MktPromotionIntegralLog> groupList); 修改前的GroupMapper.xml <insert id="batchInsertLog" parameterType="java.util.List"> INSERT INTO table (ps_id,goo

Mybatis错误:Parameter &#39;XXX&#39; not found. Available parameters are [1, 0, param1, param2]

Mybatis错误:Parameter 'XXX' not found. Available parameters are [1, 0, param1, param2] 原因:传递的参数超过一个 记 解决办法: (1)直接把值改成数字 <select id="LoginUser" parameterType="String" resultMap="userMap"> SELECT * FROM user where emplnumb

org.apache.ibatis.binding.BindingException: Parameter &#39;start&#39; not found. Available parameters are [1, 0, param1, param2]

DEBUG 2018-05-30 08:43:26,091 org.springframework.jdbc.datasource.DataSourceTransactionManager: Rolling back JDBC transaction on Connection [[email protected]]DEBUG 2018-05-30 08:43:26,091 org.mybatis.spring.SqlSessionUtils$SqlSessionSynchronization:

Parameter &#39;xxx&#39; not found. Available parameters are [collection, list]

mybatis报错问题: dao层: List<HqjTrade> queryHongbao(ArrayList<String> listType); 映射文件下sql: <select id="queryHongbao" resultType="HqjTrade" > select * from hqj_trade where tradetype in <foreach collection="listType&

Parameter &#39;name&#39; not found. Available parameters are [arg1, arg0, param1, param2]

解决方法: <select id="selectIf" resultType="student"> SELECT id,name,age,score FROM t_student WHERE 1=1 <if test="arg0 != null and arg0 !=''"> AND name LIKE '%' #{arg0} '%' </if> <if test="arg1>=0&quo

【Mybatis异常】 org.apache.ibatis.binding.BindingException: Parameter &#39;storeId&#39; not found. Available parameters are [form, param1]

一.异常信息 2019-05-31 16:06:25.272 [http-nio-10650-exec-3] WARN o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver.logException(AbstractHandlerExceptionResolver.java:192) - Resolved exception caused by Handler execution: org.mybatis.spring.MyBatisSystemExce

java 传入多个参数时报&quot;Parameter &#39;XXX&#39; not found. Available parameters are [arg1, arg0, param1,...&quot; 解决方案

@Select("SELECT id FROM ae_post ORDER BY id DESC LIMIT #{page},#{size}") List<Post> getAllForPage(@Param("page") int page, @Param("size")int size); dao层写入,解决方法如上 注:多参数需要添加 @Param("参数名") int 参数名 java 传入多个参数时报&q