0
点赞
收藏
分享

微信扫一扫

mapper与idea不兼容抛红的处理

m逆光生长 2022-07-12 阅读 60


原因:
   UserMapper 不能为spring容器解析;
解决方案:
   1.required=false;
   2.@Resource替换@Autowired  (常见面视题)
   3.在Mapper上加上@Component,(@Repository,@Component,@Service,@Controller的区别与联系);
   4.使用lombok的  @RequiredArgsConstructor(onConstructor= @__(@Autowired));
   5.按照mybatis - plugins;
   

举报

相关推荐

0 条评论