number clas 都是 bsp 配置 spa contex cnblogs
applicationContext.xml 中要配置
- configLocation">
- classpath:sqlMapConfig.xml
- basePackage" value="cn.baseapp.dao"/>
MapperScannerConfigurer 支 持 过 滤 由 指 定 的 创 建 接 口 或 注 解 创 建 映 射 器 。 annotationClass 属性指定了要寻找的注解名称。 markerInterface 属性指定了要寻找的父 接口。如果两者都被指定了, 加入到接口中的映射器会匹配两种标准。 默认情况下, 这两个 属性都是 null, 所以在基包中给定的所有接口可以作为映射器加载。因此 annotationClass 写不写都行,只要包指定到 dao 上就行了
参考 https://my.oschina.net/psuyun/blog/464851
- <
- bean
- id
- =
- "sqlSessionFactory"
- class
- =
- "org.mybatis.spring.SqlSessionFactoryBean"
- >
- <
- property
- name
- =
- "dataSource"
- ref
- =
- "dataSource"
- />
- <
- property
- name
- =
- "mapperLocations"
- value
- =
- "classpath*:sample/config/mappers/**/*.xml"
- />
- </
- bean
- >
MyBatis SpringMVC 映射配置注意
来源: http://www.bubuko.com/infodetail-2158452.html