1.     什么是延迟加载

resultMap可以实现高级映射(使用association、collection实现一对一及一对多映射),association、collection具备延迟加载功能。

需求:

如果查询订单并且关联查询用户信息。如果先查询订单信息即可满足要求,当我们需要查询用户信息时再查询用户信息。把对用户信息的按需去查询就是延迟加载。

延迟加载:先从单表查询、需要时再从关联表去关联查询,大大提高 数据库性能,因为查询单表要比关联查询多张表速度要快。

2.    打开延迟加载开关

在mybatis核心配置文件中配置:

lazyLoadingEnabled、aggressiveLazyLoading

设置项

描述

允许值

默认值

lazyLoadingEnabled

全局性设置懒加载。如果设为‘false’,则所有相关联的都会被初始化加载。

true | false

false

aggressiveLazyLoading

当设置为‘true’的时候,懒加载的对象可能被任何懒属性全部加载。否则,每个属性都按需加载。

true | false

true

    <!-- 全局配置参数,需要时再设置 -->
<settings>
<!-- 打开延迟加载 的开关 -->
<setting name="lazyLoadingEnabled" value="true"/>
<!-- 将积极加载改为消极加载即按需要加载 -->
<setting name="aggressiveLazyLoading" value="false"/>
<!-- 开启二级缓存 -->
<setting name="cacheEnabled" value="true"/>
</settings>

3.     使用association实现一对一延迟加载

3.1 需求:

  查询订单并且关联查询用户信息

3.2     mapper.xml

需要定义两个mapper的方法对应的statement。

  1、只查询订单信息

SELECT * FROM orders

在查询订单的statement中使用association去延迟加载(执行)下边的satatement(关联查询用户信息)

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAukAAABQCAIAAAAr/HzIAAAR6ElEQVR4nO2dP2sjxxvHNy8gdd6D60OFGr2DewNHOASHajdXBonAgSr9LIhxCnUHJtgyKoIFJhyOTbBDcOLmfC7UOM0h5M6k1v6K/Td/nnlmdndWq7W/Hx640+7O353Z+c4zs+sgBAAAAABoDkHdGQAAAAAAyAG0CwAAAACaBLQLAAAAAJpEIe3y913n7fmHv33nBQAAAADARiHt8vXh3Wa1S+ftOX+QvMB6ir+s2BHylOmyMuXKi8eoyqTlXjo+EpPlzqs5fj0bTHIFmln0/03eFwAAeB7YtMvXh3dv7/4gDlarXZjBi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tdO3Chfp0NOqMjj7RysVxr+6X3mAQHFwuylchAAAAADZIAb9L9mp0SqI3jt7IKzWpLtGWcqzahQt1ODE7XVy0C/wuAAAAQGPJv9+FeltHVQ9XR28y+eKyD5fWLqZQh5N+cb8LswEZAAAAAFtP7veM5ieEx0KTD9KKj7xzxVG7sKEkbUSfVWLLMo/3jAAAAIAmk/f7Luou3YjP2js+irBQ3wBKVnwOJ9rCkLAYZAqVChSX5LL3jPB9FwAAAKD55Puu7uLygNzfyrlUtgNf9QUAAACAesmlXYhduhF1KxM7vuoLAAAAAPWCvyMNAAAAgCYB7QIAAACAJuFHuwAAAAAAbAZoFwAAAAA0CWgXAAAAADQJaBcAAAAANIn/A6N1ryak7wadAAAAAElFTkSuQmCC" alt="" />

  2、关联查询用户信息

通过上边查询到的订单信息中user_id去关联查询用户信息

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAkoAAAA6CAIAAADA/OEmAAAM8klEQVR4nO2dO5KjOhSGWc8sQUlvYpbQxR4cmaRzEsrRpJ1QTklduHoNJARTHbMITcBLj3MkAXIbM/9XrntvGyQd9Pp1joRvIgEAAIDDkTzbAAAAACA+kDcAAAAHBPIGAADggEDeAAAAHBDIGwAAgAPySHlryrfzuf98NA8sJ4iqPCfnIu8ctzTp+ZyGGnpL5a9E/mmlrOSvRJ4q84a/ufyVDJ/fufm9+s0i+uS3lan3i/Fc3uoFu8LdXhv7/KKynkxVnpNz/yl3ZVgwO6neKGb8gPfWfESUt6Z8O5dfKxLGlrc/Qv4S8u84dP+02lWHCG0c6rdU/kqH/z4ZrV4RlsSi723zR8i/AalUjR8+KX2n+lzSV72vSlWekzLOUGjrYpxGlU9RP6miQobDsj7fyt/MpPYKfaMpSXkjO8BLNeVrmcHIW3cX2TWSbO9D3kLyXihv/XC9pcRcP12NzpxzK3/rrf43D1WdTeWORS94wMrvcRo15q7eVyWivE20dfG8qXAifnvxfeYV+sYSeZs4alNGNKO7i+zidFI0KHlrrkmWiXtwHh6OKW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AAAAcEMgbAACAAwJ5AwAAcEAgbwAAAA4I5A0AAMABWSFvXX7JxL3bVGxTvp3P/eej2ZQTAAAAYLNc3pprkl0jvfrSfESUt6Z8O5dfkTIDAADw0jDy1t0Fo2HVdbPrNvMj8tbdRXbJY5kMAADgFaDkrbkmGaNhkaXih7y36polWZYiCgoAAP8Npry194tDCdr7Jbma177rYtpIMwVG2WN7K+1MGXlzpeo+i6ms83vdWQZol4zniud3AgAA2DWavFXXLHE5Z01qKx/vM33XhXKp+yxsrSLkzZmq+aBl0mPJmNldZJktzwAAAI7HJG9dfsk8Z0bIQyVNyZx+7D4L3YUi5MeWN1eq77p4K+pv1ryQoyVNmmXJ5Y4fzgMAgGMT7r3x7wN09TsREmw+rIBhgLy5Un2VvOsm4b0BAACYCd57CzlU0tXvs8KFHBuh5Y1L9VWe13tvjvMyAAAADkfoycnqGuL3aKFFfReNxLv3ZmSvyid9lZRGnJwEAID/jcD33qhDJVJK69SioT3mmcYxtPhVWhFIJerIpZJSC4S6i5sv4b03AAD4/wj61ZL2fsFxDAAAAC9EiLzF+JFJAAAA4AfB/zEAAADAAfkHtBjwIUmgZP8AAAAASUVORK5CYII=" alt="" />

上边先去执行findOrdersUserLazyLoading,当需要去查询用户的时候再去执行findUserById,通过resultMap的定义将延迟加载执行配置起来。

3.3     延迟加载resultMap

使用association中的select指定延迟加载去执行的statement的id。

<!-- 延迟加载的resultMap -->
<resultMap type="cn.itcast.mybatis.po.Orders" id="OrdersUserLazyLoadingResultMap">
<!--对订单信息进行映射配置 -->
<id column="id" property="id"/>
<result column="user_id" property="userId"/>
<result column="number" property="number"/>
<result column="createtime" property="createtime"/>
<result column="note" property="note"/>
<!-- 实现对用户信息进行延迟加载
select:指定延迟加载需要执行的statement的id(是根据user_id查询用户信息的statement)
要使用userMapper.xml中findUserById完成根据用户id(user_id)用户信息的查询,如果findUserById不在本mapper中需要前边加namespace
column:订单信息中关联用户信息查询的列,是user_id
关联查询的sql理解为:
SELECT orders.*,
(SELECT username FROM USER WHERE orders.user_id = user.id)username,
(SELECT sex FROM USER WHERE orders.user_id = user.id)sex
FROM orders
-->
<association property="user" javaType="cn.itcast.mybatis.po.User"
select="cn.itcast.mybatis.mapper.UserMapper.findUserById" column="user_id">
<!-- 实现对用户信息进行延迟加载 --> </association> </resultMap>

3.4    mapper.java

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAk4AAAA3CAIAAAB1iVKCAAALcUlEQVR4nO2dvWpbSRTHZx9g67yGCyNwladQaYxgcb2FwVUwGALqjIrF2wvURLgJch8IxC4WNSYuXAXMEtjODxBvca905+OcM2fmzpXkq/+PUzh35s63zn++pJhXAAAAoNeYbRcAAAAA6BZIHQAAgJ4DqQMAANBzIHUAAAB6DqQOAABAz4HUAQAA6DmQOgAAAD0HUgcAAKDnQOoAAAD0HI3U/Tv76+SPL/8mBgEAAAA7gULqvv/9/uLvr4lB7y9O5IdkhGiQHC3vCRnERWtTr1QKJtUmL33toqGhKcu2jukVhkstYwhVf2+yzQEAGyMudV8/ses2O4h0ZKEbsv+Iuqqoc0wVp/B1L+XQ3xWsVzQRufBJFMxLaPOkvORpR9gRXIFJ2QtTI+vClVlIFgDQA2JS99/nPy4+zP5LCOI0I4yjeciFZrhyIVnNW+3rxfniLqpWKq9QeASZF8rAJaJ5S1NHfTWVrwAA+kRE6n58+fD+0z/6oND9cbNyYVpNonRS3EKB87CegEV9Ypt66eXnlaIjqZNfV04CNNrMtVjqEy6IU+WwOkKBU6cUAIA3gSx1/3y8OPn4XRVESogXxC0FSL3x8tMsEQQ/JTwXSl6wXvoyl5K69nl59eLSURY4qTBce6YWiZQ6rnhkLQAAPUCUuvQLKXp3JkjCK+V3NG6RfFHzPJpCkXopy1xK6orkpck0ddoRTccrgCxjZCFlqSPLGY4EAEBvEKQu5zsGeonifI0+Hdm9ChH00crWSy8/mvLITrlUXkJDcWmGz5V9Yb+llzGuXnJq3JCD1AHQS3ipS7+Q8rrBVZ0yKBpHk/VruVWd3tfLVd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rOOxlKO4/geiFX6oiDFWFV93I/NcPJ+GZa32yoTgEJSUtY4cUnakeXc2rCQU8IpCHav1UduTcdPcajd7TDDWjxhG/V6/OJH6SRvfZSF874ol879W5g+huH7g4jr0xWvNVajD6ry5I6a2ezyxuY6TtR9edttSZwTgWcLxu4p9z8OptJMPZ1QM3NMWdsuM5CaBbnrcxiyFLnnfbxm3vhu8cj/ydF0s7qyGMbtxhCp2QNm6fLgTxuW9zA5K6lJEld1IsOziaDm8cmWp0g4So1V9Yjw0bY9qfHhjBE3U4Jzs8irlJ3VkdvUxNSV894FPqnkzpHYJorkZPxfX1XM/ZWptS9BDdTtFLn4h1yUvs83iQx7H47Au043O/VPfD3JUVlal46OL+9PT+wI7p3KT0lpRP0XnE2MPO/V0f7dKF5xSHb7JYcjp+8nTQ7TdX6KZagf0/Mcc3CLRJ2bDi15jMij9OTiiEMbCdocDWzqkzci6Oche+bhLz4KgvFEDolc9iEl4GDHwBL/l6d56laSd0v37mF/nB0/zPYAvVdpfKrWdxXyP15zy9/dut2tH/eyXWKhXyd0pkU8v3Fjaj4qq4uf3ySqjqrg6VafH21bfAbmLDKFMdaO2iKfbCcX0uBxW3HfmmPvRvoGaSuE9u2kMWB1MF+vrzZH4QMin03PiJ+7pK8BPtGq7wztltSp75qAKnrxLYtZHEgdXtu612mt+r0/S07fvM52NjE/2zQxnZG6upDX+UA3sv/2aB727aQxYHUwWCw/THzCgAAAPQaSB0AAICeA6kDAADQcyB1AAAAeg6kDgAAQM+B1AEAAOg5kDoAAAA9B1IHAACg50DqAAAA9BxIHQAAgJ4DqQMAANBz/gdYx8WnSg704AAAAABJRU5ErkJggg==" alt="" />

3.5     测试

3.5.1           测试思路:

1、执行上边mapper方法(findOrdersUserLazyLoading),内部去调用cn.itcast.mybatis.mapper.OrdersMapperCustom中的findOrdersUserLazyLoading只查询orders信息(单表)。

2、在程序中去遍历上一步骤查询出的List<Orders>,当我们调用Orders中的getUser方法时,开始进行延迟加载。

3、延迟加载,去调用UserMapper.xml中findUserbyId这个方法获取用户信息。

  3.5.2 测试代码

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAzUAAAFBCAIAAADBohZFAAAgAElEQVR4nO2dP4vcSLf/dV/Aje8bMYZVMtnzDhwug8H0K9jUzLJg2Gx7gwHDxs8ks+DA1x17wIExGEeepBM7sPdhDTfY37PJL7h9A6nV9eecUyW1ulXq/nwomGlVqepUqVT17VMldbUBAAAAgJKopjYAAAAAADzQZwAAAABlgT4DAAAAKAv0GQAAAEBZoM8AAAAAykLUZ19vri+f3H3tGQUAAAAAIyDps/vnF1fP34jJ9aiLq0v7oJggGWUnG3ZEjNKS7VOvvoyY1T5l5dcuafCBGqrJrcswKCUIfQ2ITznmdQEAANiI+uzNreohc6PiiVCcF91/knOnnWbTX1HFpwc5xxPwiPVKZmIb34sRyzLavG9Z9vXKaeTgYiULGtBhNHuMbAEAAA5KpM++vXxy9fTmm5RWidKETpwm56AWO0B/GNnmnLV/vTRxcIiqjVVWrIQMbWrYYGfVy2Yt53wbtCixnXtJOgAAgEMQ6rPPd08vbt+LScWoeK7VJlfDOSGSOWsG/yeFTqC6kpP0PvXK10wbiQPpM/v0TOWaIyiTRQ+2ua8+E+3MlKRi1QAAAA5KoM/eP7u6fHYvpgyjRN0TRNnOkmBeDMozvB05E6dx3LB8xHrl2zyWPtu/rKBeWj45BgdtJWaVY7P4f1xQL7NFfSZWDVkGAACT4Ouz/k8G5AsCQ8dspInQmCn7aoX4eDKHUeqVafNY+myUsnIKTeoqtx3inHu1j5tzLMIM+40eJRom1iXuLQAAAEfA1WdDXquRr6u0yS8/n6QmsENOsnHrla+ZcuyxVcJYZRkNpeVplKWV2MtmNys7gZ2Prc/i4+IRAACAI+Dos/5PBmyO6D/LjEqmySl6M57/LCm8kqa6WYnJxi0rs23zy7JFVU4+mVnFUQP0WWAD+gwAACZhp8/e3F5qTwYYUUld1UufGQ4VO4g2aMKry9BIOUq9jOrYZYkk9dkoZRnisq9Vmh7qZbN4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54RAAAAAJgS6f0a62Vd8ZgAAAAAwDSE+owFTgAAAIBpqf7n//1/AoFAIBAIBEI5AX1GIBAIBAKBUFZAnxEIBAKBQCCUFf4PuOB4tszPyN8AAAAASUVORK5CYII=" alt="" />

4.     延迟加载思考

不使用mybatis提供的association及collection中的延迟加载功能,如何实现延迟加载??

实现方法如下:

定义两个mapper方法:

1、查询订单列表

2、根据用户id查询用户信息

实现思路:

先去查询第一个mapper方法,获取订单信息列表

在程序中(service),按需去调用第二个mapper方法去查询用户信息。

总之:

使用延迟加载方法,先去查询简单的sql最好单表,也可以关联查询),再去按需要加载关联查询的其它信息。

4.  一对多延迟加载

一对多延迟加载的方法同一对一延迟加载,在collection标签中配置select内容。

5.总结:

作用:

当需要查询关联信息时再去数据库查询,默认不去关联查询,提高数据库性能。

只有使用resultMap支持延迟加载设置。

场合:

当只有部分记录需要关联查询其它信息时,此时可按需延迟加载,需要关联查询时再向数据库发出sql,以提高数据库性能。

当全部需要关联查询信息时,此时不用延迟加载,直接将关联查询信息全部返回即可,可使用resultType或resultMap完成映射。

mybatis延迟加载——(十二)的更多相关文章

  1. mybatis学习 十二 多表查询

    Mybatis 实现多表查询方式: (1)业务装配.对两个表编写单表查询语句,在业务(Service)把查询的两个结果进行关联. (2)使用Auto Mapping特性,在实现两表联合查询时通过别名完 ...

  2. Spring+SpringMVC+MyBatis+easyUI整合基础篇(十二)阶段总结

    不知不觉,已经到了基础篇的收尾阶段了,看着前面的十几篇文章,真的有点不敢相信,自己竟然真的坚持了下来,虽然过程中也有过懒散和焦虑,不过结果还是自己所希望的,克服了很多的问题,将自己的作品展现出来,也发 ...

  3. Spring+SpringMVC+MyBatis深入学习及搭建(十二)——SpringMVC入门程序(一)

    转载请注明出处:http://www.cnblogs.com/Joanna-Yan/p/6999743.html 前面讲到:Spring+SpringMVC+MyBatis深入学习及搭建(十一)——S ...

  4. MyBatis基础入门《十二》删除数据 - @Param参数

    MyBatis基础入门<十二>删除数据 - @Param参数 描述: 删除数据,这里使用了@Param这个注解,其实在代码中,不使用这个注解也可以的.只是为了学习这个@Param注解,为此 ...

  5. (二十二)SpringBoot之使用mybatis generator自动生成bean、mapper、mapper xml

    一.下载mybatis generator插件 二.生成generatorConfig.xml new一个generatorConfig.xml 三.修改generatorConfig.xml 里面的 ...

  6. Spring Boot 2.X(十二):定时任务

    简介 定时任务是后端开发中常见的需求,主要应用场景有定期数据报表.定时消息通知.异步的后台业务逻辑处理.日志分析处理.垃圾数据清理.定时更新缓存等等. Spring Boot 集成了一整套的定时任务工 ...

  7. (二十二)SpringBoot之使用Druid连接池以及SQL监控和spring监控

    一.引入maven依赖 <dependencies> <dependency> <groupId>org.springframework.boot</grou ...

  8. SpringBoot系列(十二)过滤器配置详解

    SpringBoot(十二)过滤器详解 往期精彩推荐 SpringBoot系列(一)idea新建Springboot项目 SpringBoot系列(二)入门知识 springBoot系列(三)配置文件 ...

  9. 面渣逆袭:Redis连环五十二问,图文详解,这下面试稳了!

    大家好,我是老三,面渣逆袭系列继续,这节我们来搞定Redis--不会有人假期玩去了吧?不会吧? 基础 1.说说什么是Redis? Redis是一种基于键值对(key-value)的NoSQL数据库. ...

  10. Mybatis架构原理(二)-二级缓存源码剖析

    Mybatis架构原理(二)-二级缓存源码剖析 二级缓存构建在一级缓存之上,在收到查询请求时,Mybatis首先会查询二级缓存,若二级缓存没有命中,再去查询一级缓存,一级缓存没有,在查询数据库; 二级 ...

随机推荐

  1. 12.18daily_scrum

    本软件中的最后一个界面——“关于”界面的设计已经开始进行,数据传输的内容也差不多进行过半,最主要的任务依旧在测试过程中,我们组接下来还是要大力加强测试的强度和数量,注意边际数据和错误数据的测试处理: ...

  2. Linux内核分析第三周学习笔记

    linux内核分析第三周学习笔记 标签(空格分隔): 20135328陈都 陈都 原创作品转载请注明出处 <Linux内核分析>MOOC课程http://mooc.study.163.co ...

  3. HashMap相关总结

    1.HashMap:根据键值hashCode值存储数据,大多数情况下可以直接定位到它的值,但是遍历顺序不确定.所有哈希值相同的值存储到同一个链表中                         Ha ...

  4. 查看django版本的方法

    在cmd输入: python -m django --version django-admin --version

  5. 群里提到的IE设置问题 ---B/S 下页面刷新问题

    这里面四个选项的含义 下面是每个选项的作用和意义: 1. “每次访问此页时检查”选项表示浏览器每次访问一个页面时,不管浏览器是否缓存过此页面,都要向服务器发出访问请求.这种设置的优点是实时性很强,肯定 ...

  6. MT【84】夹逼定值

    分析:此类题还是比较常见的,左右都有不等式,中间夹着一个式子,我们可以找个$x$使得中间式子满足的条件显示出来. 类似的方法可以用在这道浙江高考文科压轴题上

  7. 洛谷P3950 部落冲突(LCT)

    洛谷题目传送门 最无脑LCT题解,Dalao们的各种算法都比这个好多啦... 唯一的好处就是只管码代码就好了 开战cut,停战link,询问findroot判连通性 太无脑,应该不用打注释了.常数大就 ...

  8. 【CC】Batman and Tree

    Portal --> CC Batman and Tree Solution 一开始看到很懵..感觉无从下手(因为自己太菜了qwq) ​ 膜拜了题解之后发现好像并没有想象的那么复杂qwq ​ 其 ...

  9. 织梦dedecms搜索页加上序列号autoindex

    在我们做织梦搜索页模板的时候经常会使用到autoindex标签.那么怎么才能实现搜索页可以使用呢?下面给大家分享下解决方法: 打开文件:include/arc.searchview.class.php ...

  10. git 中断 merge

    git 版本 >= 1.6.1 git reset --merge git 版本 >= 1.7.4 git merge --abort