一、MyBatis-Plus是什么?
我们先来看一下MyBatis-Plus的愿景。
我们的愿景是成为 MyBatis 最好的搭档,就像 魂斗罗 中的 1P、2P,基友搭配,效率翻倍。
从MyBatis-Plus的愿景可以看出Mybatis-Plus是一个Mybatis的增强工具,只是在Mybatis的基础上做了增强却不做改变,MyBatis-Plus支持所有Mybatis原生的特性,所以引入Mybatis-Plus不会对现有的Mybatis构架产生任何影响。
二、MyBatis存在的问题
(1)所有SQL语句全部自己写
(2)手动解析实体关系映射转换为MyBatis内部对象注入容器
(3)不支持Lambda形式调用
(4)过于依赖数据库SQL语句,导致数据库移植性差,更换数据库,如果SQL语句有差异,SQL语句工作量大。
(5)由于xml里标签id必须唯一,导致DAO中方法不支持方法重载。
三、MyBatis-Plus特性
(1)无侵入:只做增强不做改变,引入它不会对现有工程产生影响,如丝般顺滑。
(2)损耗小:启动即会自动注入基本 CURD,性能基本无损耗,直接面向对象操作。
(3)强大的 CRUD 操作:内置通用 Mapper、通用 Service,仅仅通过少量配置即可实现单表大部分 CRUD 操作,更有强大的条件构造器,满足各类使用需求。
(4)支持 Lambda 形式调用:通过 Lambda 表达式,方便的编写各类查询条件,无需再担心字段写错。
(5)支持主键自动生成:支持多达 4 种主键策略(内含分布式唯一 ID 生成器 - Sequence),可自由配置,完美解决主键问题。
(6)支持 ActiveRecord 模式:支持 ActiveRecord 形式调用,实体类只需继承Model 类即可进行强大的 CRUD 操作。
(7)支持自定义全局通用操作:支持全局通用方法注入( Write once, use anywhere )。
(8)内置代码生成器:采用代码或者 Maven 插件可快速生成 Mapper 、 Model 、 Service 、 Controller 层代码,支持模板引擎,更有超多自定义配置等您来使用。
(9)内置分页插件:基于 MyBatis 物理分页,开发者无需关心具体操作,配置好插件之后,写分页等同于普通 List 查询。
(10)分页插件支持多种数据库:支持 MySQL、MariaDB、Oracle、DB2、H2、HSQL、SQLite、Postgre、SQLServer 等多种数据库。
(11)内置性能分析插件:可输出 Sql 语句以及其执行时间,建议开发测试时启用该功能,能快速揪出慢查询。
(12)内置全局拦截插件:提供全表 delete 、 update 操作智能分析阻断,也可自定义拦截规则,预防误操作。
四、MyBatis-Plus框架结构
五、MyBatis-Plus的核心功能
如需转载,请注明文章出处和来源网址:http://www.divcss5.com/html/h64835.shtml
必备CSS教程Essential CSS Tutorials
- css height
- css line-height
- css width
- css min-width
- css max-width
- css min-height
- css max-height
- css border
- css background
- css float
- css clear
- css display
- css font
- css text-transform
- css英文首字母大写
- css font-variant
- css font-weight
- css font-style
- css text-decoration
- css 删除线
- div css 虚线
- css 注释
- html 注释
- css padding
- css margin
- css 文本
- css font-size
- css font-family
- css color
- css text-align
- css text-indent
- css 超链接(css a)
- css 优化压缩
- css id(css #)
- css class(css .)
- css ul li列表
- css 圆角圆边
- css 父级子级
- css 指针概念
- css cursor
- css overflow
- html px em pt网页单位
- CSS important
- CSS position
- css z-index
- css white-space
- css img图片
- css class id
- css link与@import区别
- css 选择器
- css引入html
必备HTML基础教程Essential HTML Tutorials
- html img图片标签
- html em标签(EM强调标签)
- html strong加粗(strong标签)
- html B加粗(b加粗标签)
- strong与B加粗区别
- h1 h2 h3 h4标签(html标题标签)
- html A超链接锚文本
- html注释
- html head头部标签
- html title标题标签
- html meta标签
- html link标签
- html i斜体标签
- html u下划线标签
- html s删除线标签
- html换行br标签
- html p段落标签
- p标签与br标签区别
- html div标签元素
- html span标签
- html font标签
- html script标签
- html px em pt网页单位
- html ul li列表
- ol li列表
- dl dt dd标签组
- table tr td表格
- table tr th表格
- html form表单
- html form input
- html form textarea文本区域
- html select下拉与跳转(Html select)
- html iframe框架
- html网页结构
- htm html shtml区别用法
- 网页编码charset
- UTF-8 GBK UTF8 GB2312区别联系
- 先写html还是先写CSS
- 显示扩展名
- html标签大全集合
- html常用标签
- 网页源代码是什么