org.apache.ibatis.binding.BindingException: Mapper method 'com.four.numfour.dao.PtableMapper.updatTb

本文详细解析了在使用MyBatis框架时遇到的更新语句返回类型不匹配问题,具体为Mapper方法updatTbaleImage的返回类型class com.four.numfour.pojo.Ptable不被支持。文章提供了问题的根源分析及解决方案,即调整Java代码中的返回类型为Integer,以确保与UPDATE语句默认返回的int类型相匹配,避免BindingException异常。

错误:

org.apache.ibatis.binding.BindingException: Mapper method 'com.four.numfour.dao.PtableMapper.updatTbaleImage' has an unsupported return type: class com.four.numfour.pojo.Ptable
    at org.apache.ibatis.binding.MapperMethod.rowCountResult(MapperMethod.java:118)
    at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:67)
    at

问题处理:

UPDATE 语句和INSERT INTO 语句 默认都返回的是 int类型  所java代码中接收的都是int类型 controller 需要改成Integer这样会减少一些意外的错误

 

使用工具提交后

类型修改后数据更新正确并不会出现 has an unsupported return type这样的问题

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值