課程
/后端開發
/Java
/SpringBoot+MyBatis搭建迷你小程序
在AreaServiceImpl的實現類中注入的AreaDao是個接口啊,并沒有它的實現類,spring容器無法通過Ioc來生成相應的bean,進而無法注入成功啊,不知道老師是怎么做到的,難道碼代碼的過程中沒有報錯嗎。
2018-08-22
源自:SpringBoot+MyBatis搭建迷你小程序 3-7
正在回答
在AreaDao添加@Repository注釋
@Configuration public?class?MapperScannerConfiguration?{ ????@Bean() ????public?MapperScannerConfigurer?getMapperScannerConfigurer(){ ????????MapperScannerConfigurer?configurer?=?new?MapperScannerConfigurer(); ????????configurer.setBasePackage("com.qnj.demo.dao"); ????????configurer.setSqlSessionFactoryBeanName("sqlSessionFactory"); ????????return?configurer; ????} }
掃描
舉報
SpringBoot+MyBatis搭建小程序后臺
2 回答AreaDao這個接口都沒有實現
1 回答areadao值為null,直接導入老師的項目也為null
1 回答AreaDao接口中的方法報:Method 'queryArea()' is never used, 生成Test時也不顯示方法
1 回答AreaDao的實現類在哪里?
1 回答AreaDao 借口的方法都沒有實現,為什么能夠調用呢
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2018-12-24
2018-08-23
掃描