Caused by: org.apache.ibatis.binding.BindingException: Parameter 'offset' not found. Available param
2017-06-08 11:38
986 查看
在调用dao层中的接口出现了下面的错误
从字面上的意思是无法完成id参数的绑定。
google之后查明这是java编程语言的一个问题,就是java没有保存行参的记录,java在运行的时候回把
中的参数变成
这样才能使mybatis识别id和num两个参数,将Dao层中的这两个参数与xml映射文件中sql语句的传入参数完成映射。
然后再次运行,测试通过!
Caused by: org.apache.ibatis.binding.BindingException: Parameter 'id' not found. Available parameters are [1, 0, param1, param2]
从字面上的意思是无法完成id参数的绑定。
google之后查明这是java编程语言的一个问题,就是java没有保存行参的记录,java在运行的时候回把
int findUserById(int id,int num);
中的参数变成
int findUserById(int arg0,int arg1);
解决办法:
这样就没有办法去传递多个参数,此时需要在接口中修改方法int findUserById(@Param("id") int id,@Param("num") int num);
这样才能使mybatis识别id和num两个参数,将Dao层中的这两个参数与xml映射文件中sql语句的传入参数完成映射。
然后再次运行,测试通过!
相关文章推荐
- mybatis异常:org.apache.ibatis.binding.BindingException: Parameter 'param' not found. Available param
- mybatis异常:org.apache.ibatis.binding.BindingException: Parameter 'param' not found. Available param
- mybatis:方法需要传入多个参数时,报错:Caused by: org.apache.ibatis.binding.BindingException: Parameter 'p_v_id' not
- mybatis多参数查询问题:org.apache.ibatis.binding.BindingException: Parameter 'name' not found. Available par
- org.apache.ibatis.binding.BindingException: Parameter 'nickname' not found. Available parameters are
- mybatis多参数查询问题:org.apache.ibatis.binding.BindingException: Parameter 'name' not found. Available par
- org.apache.ibatis.binding.BindingException: Parameter 'name' not found. Available parameters are [1,
- org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'username' not found. Available parameters are [1, 0, param1, param2]
- Caused by: org.apache.ibatis.binding.BindingException: Parameter 'stuId' not found. Available parame
- org.apache.ibatis.binding.BindingException: Parameter 'receptionList' not found. Available parameter
- org.apache.ibatis.binding.BindingException: Parameter 'id' not found.Available parameters are [0, 1,
- org.apache.ibatis.binding.BindingException: Parameter 'List' not found. Available parameters are [l
- Mybatis问题org.apache.ibatis.binding.BindingException: Parameter 'title' not found.
- ibatis.binding.BindingException: Parameter * not found. Available parameters [1, 0, param1, param2]
- mybatis方法多个参数时报错:Caused by: org.apache.ibatis.binding.BindingException: Parameter 'xxx' not found
- 关于一些mybatis异常的原因:org.apache.ibatis.binding.BindingException: Parameter 'status' not found.
- Caused by: org.apache.ibatis.type.TypeException: Could not resolve type alias 'BaseResultMap‘
- Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.Log
- Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
- 【shiro】报错:Caused by: java.lang.ClassNotFoundException: org.apache.shiro.spring.LifecycleBeanPostProcessor