mybaits异常:org.apache.ibatis.binding.BindingException: Parameter 'date' not found.
2016-04-23 21:37
786 查看
在使用mybaits遇到了如下错误:
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'date' not found. Available parameters are [3, 2, 1, 0, param1, param2, param3, param4]
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:365)
at com.sun.proxy.$Proxy9.selectOne(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:160)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:95)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:40)
......
Caused by: org.apache.ibatis.binding.BindingException: Parameter 'date' not found. Available parameters are [3, 2, 1, 0, param1, param2, param3, param4]
at org.apache.ibatis.binding.MapperMethod$MapperParamMap.get(MapperMethod.java:258)
at org.apache.ibatis.reflection.wrapper.MapWrapper.get(MapWrapper.java:40)
at org.apache.ibatis.reflection.MetaObject.getValue(MetaObject.java:123)
... 21 more
1.首先定位问题发生的具体位置,找到了一个函数中参数写法有问题,有问题的函数:
Integer addlastdaystat(Date date,Integer allcount,Integer activecount,Integer isnewcount);
2.修改问题,修改为了:
Integer addlastdaystat(@Param("date")Date date,@Param("allcount")Integer allcount,@Param("activecount")Integer activecount,@Param("isnewcount")Integer isnewcount);
总结:这是由于没有加@param("数据库表中对应的列名")导致的
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'date' not found. Available parameters are [3, 2, 1, 0, param1, param2, param3, param4]
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:365)
at com.sun.proxy.$Proxy9.selectOne(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:160)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:95)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:40)
......
Caused by: org.apache.ibatis.binding.BindingException: Parameter 'date' not found. Available parameters are [3, 2, 1, 0, param1, param2, param3, param4]
at org.apache.ibatis.binding.MapperMethod$MapperParamMap.get(MapperMethod.java:258)
at org.apache.ibatis.reflection.wrapper.MapWrapper.get(MapWrapper.java:40)
at org.apache.ibatis.reflection.MetaObject.getValue(MetaObject.java:123)
... 21 more
1.首先定位问题发生的具体位置,找到了一个函数中参数写法有问题,有问题的函数:
Integer addlastdaystat(Date date,Integer allcount,Integer activecount,Integer isnewcount);
2.修改问题,修改为了:
Integer addlastdaystat(@Param("date")Date date,@Param("allcount")Integer allcount,@Param("activecount")Integer activecount,@Param("isnewcount")Integer isnewcount);
总结:这是由于没有加@param("数据库表中对应的列名")导致的
相关文章推荐
- php环境搭建wampserver、Apache、Mysql和php
- Apache配置多个监听端口和不同的网站目录的简单方法
- apache kafka总结
- Apache shiro配置与使用(Spring整合)
- apache的/var/www/html无法访问
- centos安装Apache+MySQL+PHP
- apache查看工作模式及调优
- org.apache.spark.examples.streaming.StreamingExamples Scala 版本 无Java版本
- 防盗链apacher配置规则
- apache2.4,php5.5,mysql配置问题
- win 7下卸载Apache
- Apache Commons Collections使用方法
- Mac OS X中配置Apache
- 第七周作业 apache
- mybatis异常:org.apache.ibatis.binding.BindingException: Parameter 'param' not found. Available param
- Apache+PHP+Mysql(Windows下配置)
- Apache+php+花生壳搭建自己个个人网站,个人服务器
- apache mesos 入门(4)——mesos中的资源
- 安装xampp后,出现“Apache 2 Test Page powered by CentOS“
- Apache端口映射