写在前面
上一篇文章写了mybatis的基本原理和配置文件的基本使用,这一篇写mybatis的使用,主要包括与sping集成、动态sql、还有mapper的xml文件一下复杂配置等。值得注意的是,导图17和18中讲解resultMap子元素的时候可能讲得不是很清楚,应该需要大量的代码来讲解使用方法,思维导图恰恰不适合这种表现方法。所以需要读者根据给出的链接去读一些好的博客文章,这样才能更好理解。毕竟是技术性的东西,实践出真理。
mybatis简介
MyBatis 是支持普通 SQL查询,存储过程和高级映射的优秀持久层框架。MyBatis 消除了几乎所有的JDBC代码和参数的手工设置以及结果集的检索。MyBatis 使用简单的 XML或注解用于配置和原始映射,将接口和 Java 的POJOs(Plain Old Java Objects,普通的 Java对象)映射成数据库中的记录。
![](http://upload-images.jianshu.io/upload_images/4120002-2fef702c790c2b11.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
11、mybatis的优缺点.png
![](http://upload-images.jianshu.io/upload_images/4120002-3d791bc0c2ca011d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
12、与spring整合.png
![](http://upload-images.jianshu.io/upload_images/4120002-04fd702140d9ca40.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
13、mapper的xml文件(一).png
![](http://upload-images.jianshu.io/upload_images/4120002-c042ae8954e49daa.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
14、mapper的xml文件(二).png
![](http://upload-images.jianshu.io/upload_images/4120002-569fdc2eaac1dd6f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
15、mapper的xml文件(三).png
![](http://upload-images.jianshu.io/upload_images/4120002-7b549808b103ae15.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
16、mapper的xml文件(四).png
![](http://upload-images.jianshu.io/upload_images/4120002-8fb1249207fb4501.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
17、resultMap子元素.png
![](http://upload-images.jianshu.io/upload_images/4120002-d5f27d36aa681125.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
18、元素集合collection .png
![](http://upload-images.jianshu.io/upload_images/4120002-8ea00d072b8d88d2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
19、mapper的xml文件(五).png
![](http://upload-images.jianshu.io/upload_images/4120002-9508757e6345075e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
20、动态 SQL.png
![](http://upload-images.jianshu.io/upload_images/4120002-a97c63704014105a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
21、#{}和${}的区别.png
作者:java思维导图
链接:http://www.jianshu.com/p/8867e21655da
來源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。