mybatis使用selectByPrimaryKey出错

发布时间:2020-08-04 10:55:17 作者:home_xu
来源:网络 阅读:1790

mybatis使用selectByPrimaryKey查询时需要主键是String类型的,因此需要将表对应的实体类中的类型改成String不能为其它类型

nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='id', mode=IN, javaType=class java.lang.Integer, 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.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer

推荐阅读:
  1. spring-mybatis与原生mybatis使用对比
  2. loadrunner出错汇总

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

mybatis selectbyprimarykey sel

上一篇:类是什么

下一篇:如何调用phpcms二级导航栏标签

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》