...ibatis.binding.BindingException: Mapper method 'xxx.insert' has an unsupported return type

版权声明:转发请标明出处,谢谢! https://blog.csdn.net/Myuhua/article/details/84581624

报错信息: 大概得意思是说xxxinsert方法得返回值不支持。

org.apache.ibatis.binding.BindingException: Mapper method 'com.jd.mapper.UploadPartMapper.insert' has an unsupported return type: class com.jd.entity.UploadPartDTO
	at org.apache.ibatis.binding.MapperMethod.rowCountResult(MapperMethod.java:110)
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:58)
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
	at com.sun.proxy.$Proxy76.insert(Unknown Source)
	at com.jd.dao.UploadPartDao.insert(UploadPartDao.java:14)

报错原因:原因是返回值是UploadPartDTO是有问题。

@Mapper
public interface UploadPartMapper {
   UploadPartDTO insert(UploadPartDTO uploadPartDTO);
}

解决方法:将返回值改为int/boolean/long,不用试viod,string,char,double,int[]啥的,放心不好使的!目前测得支持前三种。

@Mapper
public interface UploadPartMapper {
    int insert(UploadPartDTO uploadPartDTO);
}

若有问题欢迎大家与我互动交流,如果文章帮到了你,请点小手指。另外,每周我会尽量至少更新一篇博客文章,喜欢的朋友可以加一下关注。

猜你喜欢

转载自blog.csdn.net/Myuhua/article/details/84581624