加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

mybatis 返回主键出错 Parameter 'ID' not found. Available

(2017-03-06 17:27:42)
标签:

it

分类: mybatis
1.错误信息
三月 06, 2017 5:04:34 下午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [springMvc] in context with path [/lst_platform] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: Error getting generated key or setting result to parameter object. Cause: org.apache.ibatis.binding.BindingException: Parameter 'ID' not found. Available parameters are [EquipmentManagement, param1]] with root cause
org.apache.ibatis.binding.BindingException: Parameter 'ID' not found. Available parameters are [EquipmentManagement, param1]
at org.apache.ibatis.binding.MapperMethod$ParamMap.get(MapperMethod.
at org.apache.ibatis.reflection.wrapper.MapWrapper.getSetterType(MapWrapper.
at org.apache.ibatis.reflection.MetaObject.getSetterType(MetaObject.


2.解决办法
修改前:
修改后:
由于插入操作参数类型是一个对象,但是返回主键是一个值,就会造成参数类型不匹配。
修改后利用对象调用其属性。最终传入的参数类型还是一个对象。

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有