我使用 AnnotationConfigApplicationContext 启动一个控制台应用程序,主类使用 @ComponentScan(basePackages = {" com.hello"})进行注释然而。它会导致错误
无效的绑定语句(未找到): com.hello.user.dao.AccountDao.remove
但是,如果我使用带有application.yml的 FileSystemXmlApplicationContext 启动应用程序就好了
mybatis:
mapperLocations: classpath:com/hello/user/dao/mapper/*.xml, classpath:com/hello/task/dao/mapper/*.xml
使用 AnnotationConfigApplicationContext 和mapper xml
应该怎么做答案 0 :(得分:0)
对于AnnotationConfigApplicationContext,在资源文件夹中添加配置文件。