本文转自:点击打开链接
在开发中我再applicationContext-dao.xml中加入了mapper扫描器
-
- <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
-
- <property name="basePackage" value="com.qianlv.ssmdemo.mapper" />
-
- <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
- </bean>
但是在编辑一个Service中注入mapper会提示could not autowire,但是可以正常执行的。
- public class ItemsServiceImpl implements com.qianlv.ssmdemo.service.ItemsService{
-
- @Autowired
- ItemsMapperCustom itemsMapperCustom;
-
- public List<ItemsCustom> findItemsList(ItemsQueryVo itemsQueryVo) throws Exception {
- return itemsMapperCustom.findItemsList(itemsQueryVo);
- }
-
- }
我们需要改一下IDEA的设置
将最右边的Serverity改为Warning