使用MapperScannerConfigurer簡化MyBatis配置

MyBatis的一大亮點就是能夠不用DAO的實現類。若是沒有實現類,Spring如何爲Service注入DAO的實例呢?MyBatis-Spring提供了一個MapperFactoryBean,能夠將數據映射接口轉爲Spring Bean。java <div><bean id="userDao" class="org.mybatis.spring.mapper.MapperFactoryBean"
相關文章
相關標籤/搜索