1. 方式一
resource指向配置文件所在位置
<mappers>
<mapper resource="org/mybatis/example/BlogMapper.xml"/>
</mappers>
2. 方式二
class类加载方式
注意:接口类和映射文件放在同一目录下,接口名称要和mapper.xml名称一致
<mappers>
<mapper class="org.mybatis.example.BlogMapper.xml"/>
</mappers>
3. 方式三
扫描整个mapper.xml所在的包
注意:mapper.xml文件和接口名字一致
<mappers>
<package name="org.mybatis.example"/>
</mappers>