本文介绍了嵌套的异常是org.apache.ibatis.binding.BindingException:找不到参数'tagId'.可用参数为[0,1,param1,param2]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

map.xml: 选择 从channel_dynamic 其中tag_id =#{tagId,jdbcType = BIGINT} 和article_id =#{articleId,jdbcType = VARCHAR}道: ChannelDynamic selectByTypeAnd(@Param(value ="tagId")长tagId,@ Param(value ="articleId")字符串articleId);

map.xml : SELECT FROM channel_dynamic where tag_id = #{tagId,jdbcType=BIGINT} and article_id = #{articleId,jdbcType=VARCHAR}Dao: ChannelDynamic selectByTypeAnd(@Param(value = "tagId" )Long tagId,@Param(value = "articleId") String articleId);

但是运行有错误org.mybatis.spring.MyBatisSystemException:嵌套的异常是org.apache.ibatis.binding.BindingException:找不到参数'tagId'.可用参数为[0,1,param1,param2]

but run has errororg.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'tagId' not found. Available parameters are [0, 1, param1, param2]

推荐答案

我同意OP的回答.这是正确的导入名称:

I agree that OP's answer.Here is correct import name:

import org.apache.ibatis.annotations.Param;

请勿使用

import io.lettuce.core.dynamic.annotation.Param;

这篇关于嵌套的异常是org.apache.ibatis.binding.BindingException:找不到参数'tagId'.可用参数为[0,1,param1,param2]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 09:28