mybatis-plus README

The project's README from github.com/baomidou/mybatis-plus. As one markdown file: README.md.

Mybatis-Plus-Logo

Born To Simplify Development

code style code style code style maven

企业版 Mybatis-Mate 高级特性

添加 微信 wx153666 备注进 mp 群

不允许非法项目使用,后果自负

Special user

aizuda-Logo mall4j-Logo

What is MyBatis-Plus?

MyBatis-Plus is a powerful and enhanced toolkit of MyBatis for simplifying development. It provides efficient, and out-of-the-box features (such as code generation, conditional query builders, pagination plugins...), effectively saving development time

Features

Getting started

This showcase is just a small part of MyBatis-Plus features. If you want to learn more, please refer to the documentation.

License

MyBatis-Plus is under the Apache 2.0 license. See the Apache License 2.0 file for details.

mybatis-plus (baomidou/mybatis-plus)

Searching Database…

这是什么?MyBatis-Plus 是 MyBatis 的增强工具包。MyBatis 是一个 Java 的 SQL 映射框架,MyBatis-Plus 在它之上提供了开箱即用的功能,用来简化数据库开发、少写很多代码。
那我是用它替代 MyBatis,还是在 MyBatis 上面加一层用?是在 MyBatis 之上用的。它和 MyBatis 完全兼容,启动时会自动完成配置,所以你现有的 MyBatis 代码照常运行,同时还能用到它带来的额外功能。
我怎么把它加到项目里?用 Maven 或 Gradle 添加依赖即可,官方为 Spring Boot 2、3、4 都提供了 starter。然后让你的 mapper 接口继承 BaseMapper,它里面的方法就可以直接使用了。
它支持哪些 Java 和 Spring Boot 版本?starter 覆盖 Spring Boot 2、3 和 4:Spring Boot 2 这条线在 JDK 8 上运行,Spring Boot 3 和 4 则需要 JDK 11 及以上。目前的版本在 3.5.x 系列。
使用上有什么限制需要我知道的吗?README 中警告:违法违规项目不得使用本工具,否则后果自负。高级功能单独放在一个叫 Mybatis-Mate 的企业版里,需要通过微信联系获取。
每个查询我还得自己写 SQL 吗?不用。mapper 继承 BaseMapper 之后,就自带了一套数据库操作的通用接口;自定义的查询条件也不用手写 SQL,通过灵活的条件构造器(where 封装)和 Lambda 风格的 API 就能拼出来。
分页是怎么实现的?是自动的:分页功能以内置插件的形式提供,README 把它和代码生成、条件查询构造器一起列为核心功能。
它能根据我的表生成那些重复的样板代码吗?可以。它内置了一个高度可定制的代码生成器,README 里还专门链接了一份单独的 Code Generator(代码生成器)指南。
它能防 SQL 注入吗?能,SQL 注入防护是它的内置功能之一。
Creator
baomidou
Size
32.2 MB
Stars
17.5K
Age
10y
Commits · 90 Days