首页 > 其他 > 详细

mybatis使用selectByPrimaryKey出错

时间:2018-10-25 19:13:11      阅读:162      评论:0      收藏:0      [点我收藏+]
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

mybatis使用selectByPrimaryKey出错

原文:http://blog.51cto.com/xuguohongai/2308981

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!