Skip to content

Introduction

MyBatis-Plus is an enhancement tool for MyBatis. It builds upon MyBatis without making any changes, aiming to simplify development and improve efficiency.

Relationship Between MyBatis and MyBatis-Plus

Features

  • Non-intrusive: Only enhances without altering existing code. Introducing it won’t affect your current project—smooth as silk.
  • Minimal overhead: Automatically injects basic CRUD operations upon startup with negligible performance impact, enabling direct object-oriented operations.
  • Powerful CRUD operations: Built-in universal Mapper and Service. With minimal configuration, you can perform most single-table CRUD operations. Plus, a robust condition constructor meets diverse needs.
  • Lambda-style calls: Write query conditions conveniently using Lambda expressions, eliminating worries about field typos.
  • Automatic primary key generation: Supports up to 4 primary key strategies (including distributed unique ID generator - Sequence), configurable freely to solve primary key issues perfectly.
  • ActiveRecord mode support: Entities can inherit the Model class to perform powerful CRUD operations in ActiveRecord style.
  • Custom global operations: Supports global generic method injection (Write once, use anywhere).
  • Built-in code generator: Quickly generate Mapper, Model, Service, and Controller layer code via code or Maven plugin. Supports template engines and offers numerous custom configurations.
  • Built-in pagination plugin: Based on MyBatis physical pagination. Developers need not worry about details—configure the plugin, and pagination queries work like regular List queries.
  • Pagination plugin supports multiple databases: MySQL, MariaDB, Oracle, DB2, H2, HSQL, SQLite, PostgreSQL, SQLServer, and more.
  • Built-in performance analysis plugin: Outputs SQL statements and their execution time. Recommended for development/testing to quickly identify slow queries.
  • Built-in global interceptor plugin: Intelligently analyzes and blocks full-table delete/update operations. Custom rules can be added to prevent accidents.

Supported Databases

Framework Structure

framework

Code Hosting

Contributing

We welcome contributions from everyone to improve MyBatis-Plus! We look forward to your PRs.

Tutorials, Examples, and Users

Visit Awesome-MyBatis-Plus for details.

Baomidou

© 2016-2025 Baomidou™. All Rights Reserved.

Power by Astro Starlight | Sponsored by JetBrains

渝ICP备2021000141号-1 | 渝公网安备50011302222097