mybatis 引入映射器的方法

来源:互联网 发布:查看linux系统版本命令 编辑:程序博客网 时间:2024/06/07 18:50

引入映射器的方法

引入映射器分为三种方式
1. 文件路径引入映射器

<mappers>        <mapper resource="com/test/model/LoginLogMapper.xml"/>    </mappers>
  1. 用包名引入映射器
<mappers>        <package name="com.test.model"/>    </mappers>
  1. 用类注册引入映射器
<mappers>        <mapper class="com.test.model.LoginLogMapper"/>    </mappers>
  1. 用userMapper引入映射器

    <mappers>
    <mapper url="file://001.Mybatis环境搭建/src/com/test/model/LoginLogMapper.xml"/>
    </mappers>