Mapper red line annotated by @Autowired

 

As shown. . . This is not wrong, but the container cannot be assembled automatically. . As a programmer, all are allergic to red.

There are two solutions: 1. Change the idea warning color

2. You can add @Repository annotations to Mapper or dao layer classes

Xiaobai recommends the second one!

 

Guess you like

Origin blog.csdn.net/qq_36090127/article/details/102665597