Springboot and MyBatis After integration, if you follow spring's consolidation habits, you may find an error:
Application FAILED to START ***************************
Description:
Field Entfiledao in Com.alibaba.serviceImpl.EntFileServiceImpl required a bean of type ' com.alibaba.dao.EntFileDao ' that Could not being found.
Action:
Consider defining a bean of type ' Com.alibaba.dao.EntFileDao ' in your configuration.
This was due to the fact that the springboot was not scanned to Com.alibaba.dao.EntFileDao when it started, and @autowired was used in Com.alibaba.serviceImpl.EntFileServiceImpl. Private Enfiledao Entfiledao are assembled, so errors are found and said to be undefined. At this point, you need to add an annotation on the Springboot startup class: @MapperScan ("Persistent layer path"), which will scan to Com.alibaba.dao.EntFileDao.
Complete integration steps can be consulted: Spring Boot---(8) springboot integrated MyBatis