当前位置:主页 > 软件编程 > JAVA代码 >

MyBatis 引入映射器的方法

时间:2021-03-06 10:12:25 | 栏目:JAVA代码 | 点击:

mybatis引入映射器分为三种方式

1. 文件路径引入映射器

<mappers>
    <mapper resource="com/test/model/LoginLogMapper.xml"/>
  </mappers>

用包名引入映射器

<mappers>
    <package name="com.test.model"/>
  </mappers>

用类注册引入映射器

<mappers>
    <mapper class="com.test.model.LoginLogMapper"/>
  </mappers>

用userMapper引入映射器

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

总结

您可能感兴趣的文章:

相关文章