2022-1-7-Java-报错

Mybatis报错Mapper method 'xxx' has an unsupported return type

说明sql语句已经执行成功,数据库数据已经收到sql语句影响,但是返回类型错误。

insert,delete,update添删改的返回类型为int,将增删改的接口改为int或者void,spring boot项目里面,对应的语句mapper文件中必须得是int或者void

select可以是自定义对象或者list、map。注意resultType和resultMap的使用

Mybatis报错Result Maps conllection does not contain value for java.lang.Integer

mapper配置文件(即写sql语句的文件)某个select返回为:resultMap=" java.lang.Integer",改为resultType即可

不一定是报错文件的位置,可能是其他mapper配置文件。-----搜索resultMap=" java.lang.Integer"找到即可

 

posted @ 2022-01-07 09:27  小洲不爱睡觉  阅读(171)  评论(0)    收藏  举报