第一种依据 Mapper 类 具体路径 配置 Mapper
这种情况下,如果是非注解模式的话xml配置文件必须和这个类在同一级目录,且与Mapper类同名
<configuration>
<mappers>
<!-- class 级别的指定 -->
<mapper class="com.bestcxx.stu.springmvc.mapper.UserModelMapper"/>
<mapper class="com.bestcxx.stu.springmvc.mapper.UserModelTwoMapper"/>
</mappers>
</configuration>
第二种依据 Mapper 类所在的package包路径 配置 Mapper
这种情况下,如果是非注解模式的话xml配置文件必须也处于同一级 package 下,且与Mapper类同名
<configuration>
<mappers>
<package name="com.bestcxx.stu.springmvc.mapper"/>
</mappers>
</configuration>
第三种是把 Mapper 的xml配置文件单独放置到 resources 中,和Mapper 类分开了
这种方式的好处是便于统一管理 xml 配置文件,不好的的地方是无法使用注解模式了
<configuration>