Mapper XML files contain the mapped SQL statements that will be executed by the application using statement id. We need to configure the locations of the SQL Mapper files in mybatis-config.xml.

<mappers>
<mapper resource="com/mybatis3/mappers/StudentMapper.xml"/>
<mapper url="file:///D:/mybatisdemo/app/mappers/TutorMapper.xml"/>
<mapper class="com.mybatis3.mappers.TutorMapper"/>
<package name="com.mybatis3.mappers"/>
</mappers>

Each of the <mapper> tag attributes facilitates to load mappers from different kinds of sources:

  • The attribute resource can be used to point to a mapper file that is in the classpath
  • The attribute url can be used to point to a mapper file by its fully qualified filesystem path or web URL
  • The attribute class can be used to point to a Mapper interface
  • The package element can be used to point to a package name where Mapperinterfaces can be found

MyBatis(3.2.3) - Configuring MyBatis using XML, Mappers的更多相关文章

  1. MyBatis(3.2.3) - Configuring MyBatis using XML, Environment

    The key component of MyBatis is SqlSessionFactory from which we get SqlSession and execute the mappe ...

  2. MyBatis(3.2.3) - Configuring MyBatis using XML, typeHandlers

    As discussed in the previous chapter, MyBatis simplifies the persistent logic implementation by abst ...

  3. MyBatis(3.2.3) - Configuring MyBatis using XML, typeAliases

    In the SQL Mapper configuration file, we need to give the fully qualified name of the JavaBeans for ...

  4. MyBatis(3.2.3) - Configuring MyBatis using XML, Settings

    The default MyBatis global settings, which can be overridden to better suit application-specific nee ...

  5. MyBatis(3.2.3) - Configuring MyBatis using XML, Properties

    The properties configuration element can be used to externalize the configuration values into a prop ...

  6. Mybatis增加对象属性不增加mapper.xml的情况

    Mybatis增加对象属性不增加mapper.xml的情况: 只增加Model 对象的属性,在查询语句中返回相同名称的字段,但是在mapper中的 resultMap上面不进行新增字段的增加,查询结果 ...

  7. Mybatis之旅第三篇-SqlMapConfig.xml全局配置文件解析

    一.前言 刚换工作,为了更快的学习框架和了解业务,基本每天都会加班,导致隔了几天没有进行总结,心里总觉得不安,工作年限越长越感到学习的重要性,坚持下去!!! 经过前两篇的总结,已经基本掌握了mybat ...

  8. Mybatis学习总结(三)——SqlMapConfig.xml全局配置文件解析

    经过上两篇博文的总结,对mybatis中的dao开发方法和流程基本掌握了,这一节主要来总结一下mybatis中的全局配置文件SqlMapConfig.xml在开发中的一些常用配置,首先看一下该全局配置 ...

  9. Java Persistence with MyBatis 3(中文版) 第三章 使用XML配置SQL映射器

    关系型数据库和SQL是经受时间考验和验证的数据存储机制.和其他的ORM 框架如Hibernate不同,MyBatis鼓励开发者可以直接使用数据库,而不是将其对开发者隐藏,因为这样可以充分发挥数据库服务 ...

随机推荐

  1. Intel HAXM

    Hardware Accelerated Execution Manager的缩写. intel的硬件加速执行管理器,是一款可以使用英特尔虚拟化技术(VT)加快 Android* 开发速度的硬件辅助虚 ...

  2. [置顶] stax解析xml文档的6种方式

    原文链接:http://blog.csdn.net/u011593278/article/details/9745271 stax解析xml文档的方式: 基于光标的查询: 基于迭代模型的查找: 基于过 ...

  3. C# 常用日期类型转换帮助类

    本文转载:http://www.cnblogs.com/iamlilinfeng/p/3378659.html 最近工作比较忙,与此同时自己也在业余时间开发一个电子商务网站.虽然每天都很累,但感觉过的 ...

  4. Posting data to a HttpHandler greater then ~29MB gives a 404 error

    1down votefavorite 1 I am testing a HttpHandler that accepts XML. It works fine when a small amount ...

  5. 小菜学习MVC4-WebApi

    今天想看下MVC4的东西,发现 居然有WebApi这东西,百度了一下..居然是 WCF中的东西,然后移植到了MVC4中,WCF你懂得返回数据都是xml,向网站这种请求 就比较纠结...而webapi可 ...

  6. X64 Win7(win2008)连接SqlServer2005慢的解决办法

    问题描述:数据库版本:SQL SERVER 2005数据库安装环境: Win 2003 X64 客户端环境:Win 2008 x64连接工具:ODBC或ado.net测试连接时间:4-6秒 客户端环境 ...

  7. Android开发 MMS支持 创建和编辑MMS

    Composing and editing MMS在Android Mms 应用里面的具体实现形式,或数据结构是SlideshowModel,它是一个每个节点为SlideModel的 ArrayLis ...

  8. iOS开发——网络编程Swift篇&(一)网络监测

    网络监测 enum ReachabilityType { case WWAN, WiFi, NotConnected } public class Reachability { /** :see: O ...

  9. 解决easyui-datagrid在ie中无法reload问题

    easyui在页面载入时,会自己主动填充datagrid中的数据,当加入.改动.删除后,会触发reload事件,对datagrid进行又一次载入. 这个过程在FireFox中没有问题,用firebug ...

  10. cocos2dx-3.2 环境配置

    一.软件 1)VS2012(C++11特性在VS2012以上可以使用) 2)Cocos2d-x官网源码 3)JDK 4)NDK(3.2要用r9d版本,用了android-ndk-r8e报错了) 5)A ...