使用mybatis主键回填时报不支持返回数据类型
Mapper method ‘xxxx’ has an unsupported return type: xxxxx
解决方法:
1、返回值是对象 返回的也是你传的值的那个对象不是新new一个对象去接受,报这个错误直接抛掉然后打印就好了!
// 在插入这里try掉就可以正常打印了
try {
userMapper.insertUser(user);
} catch (Exception e) {
System.out.println(user.getUserId());
}
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/d7968ffbf2c80d4ec43831bf81f95368.png)
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/aeefa7630da1eac015cf8df201c098e1.png)
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/88b1128bbb0e70f62fe1717a1e8cfe88.png)