码迷,mamicode.com
首页 > 其他好文 > 详细

myBatis的binding错误:Invalid bound statement (not found)

时间:2018-06-18 13:29:00      阅读:449      评论:0      收藏:0      [点我收藏+]

标签:org   ida   gui   property   tis   pen   UI   ring   java   

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   ida   gui   property   tis   pen   UI   ring   java   

原文地址:https://www.cnblogs.com/zjulanjian/p/9194895.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!