springboot整合mybatis-plus遇到的问题扫描不到Mapper接口
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.zhao.mapper.UserMapper’ available: expected at least 1 bean which qualifies as autowire cand
·
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.zhao.mapper.UserMapper’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
之前整合过一次了没有出现过这种问题,不知道是不是因为整合Druid出现的问题(很是疑惑)
解决方法
方法一:通过@Mapper注解去扫描一下我们的Mapper接口
方法一:通过在主入口使用@MapperScan注解去扫描一下我们的Mapper包
更多推荐
已为社区贡献2条内容
所有评论(0)