码迷,mamicode.com
首页 > 其他好文 > 详细

mybatis使用selectByPrimaryKey出错

时间:2018-10-25 19:26:20      阅读:435      评论:0      收藏:0      [点我收藏+]

标签:ror   nes   因此   use   查询   api   类型   code   setting   

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出错

标签:ror   nes   因此   use   查询   api   类型   code   setting   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!