Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
众所周知,我们MapperFactoryBean为DAO接口定义了一个与mapper.xml. 但是随着mapper.xml以及DAO接口的增加,我需要MapperFactoryBean在mybatis-config.xml. 有没有办法可以自动为我做那件事?就像简单context:component-scan,代码一句,spring会自动检测bean本身。非常感谢!
MapperFactoryBean
DAO
mapper.xml
mybatis-config.xml
context:component-scan
是的。看看文档:
http://mybatis.github.io/spring/mappers.html#scan