Intellij IDEA tips error when injecting MyBatis mapper Java interface using @Autowired
Background
Intellij IDEA tips inspection error when injecting MyBatis mapper Java interface using @Autowired
|
Error Info
Could not autowire. No beans of 'MyMapper' type found. |
Solutions
It is not really an error, but error tips are annoying.
Solution 1: Add @Repository
or @Component
annotation in top of MyBatis Mapper interface classes.
|
Solution 2: Using @Resource annotation to inject MyBatis Mapper interface classes.
|