myBatis的binding错误:Invalid bound statement (not found)
Posted 何茫然zju
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了myBatis的binding错误:Invalid bound statement (not found)相关的知识,希望对你有一定的参考价值。
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)错误
这个问题我找了好久,终于找到了
正确的写法:
<select id="getEmpByIdAndLastName" resultType="com.atguigu.mybatis.bean.Employee">
select id, last_name, gender, email from tbl_employee where id = #{id} and last_name = #{last_name}
</select>
错误的写法:
<select id="getEmpByIdAndLastName" resultType="com.atguigu.mybatis.bean.Employee">
select * from tbl_employee where id = #{id} and last_name = #{last_name}
</select>
Mapped Statements collection does not contain value for com.atguigu.mybatis.dao.DeparmentMapper.getDeptById
Cause: org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property=‘__frch_emp_0.last_name‘, mode=IN, javaType=class java.lang.String, jdbcType=null, numericScale=null, resultMapId=‘null‘, jdbcTypeName=‘null‘, expression=‘null‘}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #1 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
以上是关于myBatis的binding错误:Invalid bound statement (not found)的主要内容,如果未能解决你的问题,请参考以下文章
org.apache.ibatis.binding.BindingException: Invalid bound statement Mybatis绑定错误问题解决
Maven项目使用mybatis报错 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):(
使用springBoot和mybatis整合时出现如下错误:org.apache.ibatis.binding.BindingException: Invalid bound statement (n
Mybatis报错org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)问题解决办法汇总(示例代
Mybatis报错org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)问题解决办法汇总(示例代