MyBaties--Mapper configuration

Posted Nyan

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MyBaties--Mapper configuration相关的知识,希望对你有一定的参考价值。

method one:

<!-- Using classpath relative resources -->
<mappers>
  <mapper resource="org/mybatis/builder/AuthorMapper.xml"/>
  <mapper resource="org/mybatis/builder/BlogMapper.xml"/>
  <mapper resource="org/mybatis/builder/PostMapper.xml"/>
</mappers>

method two:

<!-- Using url fully qualified paths -->
<mappers>
  <mapper url="file:///var/mappers/AuthorMapper.xml"/>
  <mapper url="file:///var/mappers/BlogMapper.xml"/>
  <mapper url="file:///var/mappers/PostMapper.xml"/>
</mappers>

method three:

<!-- Using mapper interface classes -->
<mappers>
  <mapper class="org.mybatis.builder.AuthorMapper"/>
  <mapper class="org.mybatis.builder.BlogMapper"/>
  <mapper class="org.mybatis.builder.PostMapper"/>
</mappers>

method four:

<!-- Register all interfaces in a package as mappers -->
<mappers>
  <package name="org.mybatis.builder"/>
</mappers>

 

以上是关于MyBaties--Mapper configuration的主要内容,如果未能解决你的问题,请参考以下文章

Linux中的./configure

@Configuration的作用

没有configure的文件,无法执行./configure命令怎么解决

我的eclipse里面为啥有吗configure这个选项

通过合并两个配置文件来创建 System.Configuration.Configuration?

autoreconf:需要“configure.ac”或“configure.in”