×
深入浅出MyBatis技术原理与实战

深入浅出MyBatis技术原理与实战

1星价 ¥33.8 (4.9折)
2星价¥33.8 定价¥69.0

温馨提示:5折以下图书主要为出版社尾货,大部分为全新(有塑封/无塑封),个别图书品相8-9成新、切口有划线标记、光盘等附件不全详细品相说明>>

暂无评论
图文详情
  • ISBN:9787121295942
  • 装帧:一般胶版纸
  • 册数:暂无
  • 重量:暂无
  • 开本:32开
  • 页数:268
  • 出版时间:2016-09-01
  • 条形码:9787121295942 ; 978-7-121-29594-2

本书特色

当前已经是移动互联网时代,java持久框架hibernate没有办法适应高性能,灵活,大数据,可优化等要求,这时mybatis就进入了我们的视野,随着移动互联网应用的持续发酵,spring mybatis的应用已在java互联网平台上得到大量的使用,单单在51job招聘网站中mybatis在全国也有近万个岗位的需求,加上未在51job发布的企业,可见需求相当大,而在当今市场上却没有任何一本介绍mybatis的书籍,为了填补这一空白本书主要介绍了java mybatis技术。本书详细介绍了mybatis的基础组成、配置、映射器、动态sql,教会读者正确使用mybatis,书中包含大量的实例,使读者可以参考。接着介绍了mybatis的运行原理和插件开发并配有一个完整的插件例子。为了增加实用性,作者还介绍了mybatis-spring项目,使得读者能够学习到如何把mybatis整合到spring项目中,*后作者还将讲解一些常用实例,比如blob字段、文件上传、批量、动态表名等实用场景,让读者能够参考和注意一些细节的问题。本书从基础讲到底层,注重实战,原理,照顾到初中高三类读者,可以作为mybatis的学习教程和参考技术丛书。

内容简介

当前已经是移动互联网时代,Java持久框架Hibernate没有办法适应高性能,灵活,大数据,可优化等要求,这时MyBatis就进入了我们的视野,随着移动互联网应用的持续发酵,Spring+MyBatis的应用已在Java互联网平台上得到大量的使用,单单在51job招聘网站中MyBatis在全国也有近万个岗位的需求,加上未在51job发布的企业,可见需求相当大,而在当今市场上却没有任何一本介绍MyBatis的书籍,为了填补这一空白本书主要介绍了Java MyBatis技术。本书详细介绍了MyBatis的基础组成、配置、映射器、动态SQL,教会读者正确使用MyBatis,书中包含大量的实例,使读者可以参考。接着介绍了MyBatis的运行原理和插件开发并配有一个完整的插件例子。为了增加实用性,作者还介绍了MyBatis-Spring项目,使得读者能够学习到如何把MyBatis整合到Spring项目中,*后作者还将讲解一些常用实例,比如Blob字段、文件上传、批量、动态表名等实用场景,让读者能够参考和注意一些细节的问题。本书从基础讲到底层,注重实战,原理,照顾到初中高三类读者,可以作为MyBatis的学习教程和参考技术丛书。

目录

目 录第1 章 mybatis 简介.................................................................................................................................. 11.1 传统的jdbc 编程........................................................................................................................ 11.2 orm 模型....................................................................................................................................... 41.3 hibernate.................................................................................................................................... 41.4 mybatis ..................................................................................................................................... 91.5 什么时候用mybatis....................................................................................................................12第2 章 mybaits 入门.........................................................................................................................132.1 开发环境准备...............................................................................................................................132.1.1 下载mybatis .........................................................................................................................132.1.2 搭建开发环境........................................................................................................................142.2 mybatis 的基本构成....................................................................................................................152.2.1 构建sqlsessionfactory..........................................................................................................152.2.2 创建sqlsession.....................................................................................................................192.2.3 映射器...................................................................................................................................212.3 生命周期.........................................................................................................................................262.3.1 sqlsessionfactorybuilder.......................................................................................................272.3.2 sqlsessionfactory..................................................................................................................272.3.3 sqlsession..............................................................................................................................272.3.4 mapper...................................................................................................................................282.4 实例...........................................................................................................................................29第3 章 配置.........................................................................................................................................373.1 properties 元素...............................................................................................................................383.1.1 property 子元素......................................................................................................................383.1.2 properties 配置文件...............................................................................................................393.1.3 程序参数传递........................................................................................................................393.1.4 优先级...................................................................................................................................403.2 设置.........................................................................................................................................413.3 别名........................................................................................................................................443.3.1 系统定义别名........................................................................................................................443.3.2 自定义别名............................................................................................................................473.4 typehandler 类型处理器.............................................................................................................483.4.1 系统定义的typehandler........................................................................................................493.4.2 自定义typehandler................................................................................................................513.4.3 枚举类型typehandler............................................................................................................553.5 objectfactory.................................................................................................................................623.6 插件..................................................................................................................................................653.7 environments 配置环境...............................................................................................................653.7.1 概述.......................................................................................................................................653.7.2 数据库事务............................................................................................................................663.7.3 数据源...................................................................................................................................673.8 databaseidprovider 数据库厂商标识.......................................................................................683.8.1 使用系统默认规则................................................................................................................683.8.2 不使用系统默认规则............................................................................................................693.9 引入映射器的方法.......................................................................................................................71第4 章映射器..............................................................................................................................................734.1 映射器的主要元素.......................................................................................................................734.2 select 元素......................................................................................................................................744.2.1 概述.......................................................................................................................................744.2.2 简易数据类型的例子............................................................................................................754.2.3 自动映射...............................................................................................................................764.2.4 传递多个参数........................................................................................................................784.2.5 使用resultmap 映射结果集..................................................................................................814.3 insert 元素......................................................................................................................................824.3.1 概述.......................................................................................................................................824.3.2 主键回填和自定义................................................................................................................834.4 update 元素和delete 元素..........................................................................................................854.5 参数..................................................................................................................................................854.5.1 参数配置...............................................................................................................................864.5.2 存储过程支持........................................................................................................................864.5.3 特殊字符串替换和处理(#和$).........................................................................................874.6 sql 元素...........................................................................................................................................884.7 resultmap 结果映射集.................................................................................................................894.7.1 resultmap 元素的构成...........................................................................................................894.7.2 使用map 存储结果集............................................................................................................914.7.3 使用pojo 存储结果集.........................................................................................................914.7.4 级联.......................................................................................................................................924.8 缓存cache ....................................................................................................................................1134.8.1 系统缓存(一级缓存和二级缓存)...................................................................................1134.8.2 自定义缓存..........................................................................................................................117第5 章 动态sql ......................................................................................................................................1195.1 概述................................................................................................................................................1195.2 if 元素............................................................................................................................................1205.3 choose、when、otherwise 元素..............................................................................................1205.4 trim、where、set 元素..............................................................................................................1215.5 foreach 元素.................................................................................................................................1235.6 test 的属性....................................................................................................................................1245.7 bind 元素.......................................................................................................................................125第6 章 mybatis 的解析和运行原理.....................................................................................................1276.1 涉及的技术难点简介.................................................................................................................1286.1.1 反射技术..............................................................................................................................1296.1.2 jdk 动态代理......................................................................................................................1306.1.3 cglib 动态代理.................................................................................................................1336.2 构建sqlsessionfactory 过程...................................................................................................1346.2.1 构建configuration...............................................................................................................1356.2.2 映射器的内部组成..............................................................................................................1366.2.3 构建sqlsessionfactory........................................................................................................1386.3 sqlsession 运行过程..................................................................................................................1386.3.1 映射器的动态代理..............................................................................................................1386.3.2 sqlsession 下的四大对象....................................................................................................1426.3.3 sqlsession 运行总结............................................................................................................150第7 章 插件.................................................................................................................................................1527.1 插件接口.......................................................................................................................................1527.2 插件的初始化..............................................................................................................................1537.3 插件的代理和反射设计............................................................................................................1547.4 常用的工具类——metaobject................................................................................................1577.5 插件开发过程和实例.................................................................................................................1597.5.1 确定需要拦截的签名..........................................................................................................1597.5.2 实现拦截方法......................................................................................................................1617.5.3 配置和运行..........................................................................................................................1627.5.4 插件实例..............................................................................................................................1637.6 总结................................................................................................................................................166第8 章 mybatis-spring...........................................................................................................................1688.1 spring 的基础知识......................................................................................................................1688.1.1 spring ioc 基础...................................................................................................................1698.1.2 spring aop 基础..................................................................................................................1718.1.3 spring 事务管理...................................................................................................................1738.1.4 spring mvc 基础.................................................................................................................1798.2 mybatis-spring 应用..................................................................................................................1818.2.1 概述.....................................................................................................................................1818.2.2 配置sqlsessionfactory........................................................................................................1828.2.3 配置sqlsessiontemplate.....................................................................................................1848.2.4 配置mapper.........................................................................................................................1888.2.5 配置事务..............................................................................................................................1908.3 实例................................................................................................................................................1918.3.1 环境准备..............................................................................................................................1918.3.2 文件目录..............................................................................................................................1938.3.3 spring 配置文件...................................................................................................................1948.3.4 mybatis 框架相关配置........................................................................................................1988.3.5 配置服务层..........................................................................................................................2058.3.6 编写控制器..........................................................................................................................2098.3.7 测试.....................................................................................................................................2108.4 总结................................................................................................................................................210第9 章 实用的场景...................................................................................................................................2129.1 数据库blob 字段读写...........................................................................................................2129.2 批量更新.......................................................................................................................................2159.3 调用存储过程..............................................................................................................................2179.3.1 存储过程in 和out 参数的使用..........................................................................................2179.3.2 存储过程游标......................................................................................................................2209.4 分表................................................................................................................................................2259.5 分页................................................................................................................................................2279.5.1 rowbounds 分页..................................................................................................................2279.5.2 插件分页..............................................................................................................................2299.6 上传文件到服务器.....................................................................................................................2399.7 在映射中使用枚举.....................................................................................................................2479.8 多对多级联..................................................................................................................................2499.9 总结................................................................................................................................................253附录a 数据库模型描述与级联学生关系建表语句.......................................................254
展开全部

作者简介

杨开振 长期从事Java开发工作,拥有近十年的Java开发经验,目前就职于一家互联网金融公司,担任互联网软件开发职位。 IT技术的狂热爱好者,热衷于Java互联网方向的软件技术开发与研究。 熟练掌握Java基础、软件开发设计模式和数据库相关知识,对Spring、MyBatis等主流Java开源框架有深入研究。

预估到手价 ×

预估到手价是按参与促销活动、以最优惠的购买方案计算出的价格(不含优惠券部分),仅供参考,未必等同于实际到手价。

确定
快速
导航