[Open Source] An elegant MyBatis enhancement framework that is lightweight, focused on enhancements, high-performance, and flexible.
![[Open Source] An elegant MyBatis enhancement framework that is lightweight, focused on enhancements, high-performance, and flexible.](https://yy123.ink/api/img/1782591385380-5c0zef.jpg)
One Flying Open-source - Open-source recommendation, committed to pushing open-source project technology applications to target users in the first time, reducing the difficulty and cost of open-source authors, open-source teams, and open-source organizations in promoting and promoting open-source projects, and accurately and smoothly transmitting value and sharing win-win!
1. Project Overview

MyBatis-Flex: An Elegant MyBatis Enhancement Framework
MyBatis-Flex is an elegant MyBatis enhancement framework that is lightweight while offering excellent performance and flexibility. You can easily use MyBatis-Flex to connect to any database. Its built-in QueryWrapper^highlight greatly reduces the amount of SQL code you need to write while minimizing the possibility of errors.
In short, MyBatis-Flex can significantly improve development efficiency and the overall development experience, giving you more time to focus on what matters.
2. Open Source License
Licensed under Apache-2.0
3. Screenshots



4. Feature Overview
Features
1. Lightweight
The entire MyBatis-Flex framework depends only on MyBatis, with no other third-party dependencies.
2. Enhancement Only
MyBatis-Flex supports CRUD, pagination queries, multi-table queries, and batch operations without removing any of the original MyBatis functionality.
3. High Performance
MyBatis-Flex adopts a unique technical architecture. Compared with similar frameworks (such as MyBatis-Plus), its performance in insert, delete, update, and query operations is 5–10 times or even higher.
4. Greater Flexibility
MyBatis-Flex supports multiple primary keys, multi-table queries, logical deletion, optimistic locking, data masking, data encryption, multiple data sources, database and table sharding, field-level permissions, field encryption, multi-tenancy, transaction management, SQL auditing, and much more. All these features are free and flexible.
5. Tech Stack
Quick Start
Before getting started, we assume that you already:
- Are familiar with Java environment configuration and development.
- Are familiar with relational databases such as MySQL.
- Are familiar with Spring Boot and related frameworks.
- Are familiar with Java build tools such as Maven.
For detailed information, please refer to the README.md documentation.
MyBatis-Flex Feature Comparison with Similar Frameworks
MyBatis-Flex is primarily compared with MyBatis-Plus and Fluent-MyBatis. The information comes from their official websites, Git repositories, and online articles. Corrections are welcome if any information is inaccurate.
- MyBatis-Plus: An established MyBatis enhancement framework, open-sourced in 2016.
- Fluent-MyBatis: A MyBatis enhancement framework developed by Alibaba Cloud (from the Alibaba Cloud·Cloud Effect product team).
Feature Comparison
Feature or Characteristic
MyBatis-Flex
MyBatis-Plus
Fluent-MyBatis
Basic CRUD operations on entities
✅
✅
✅
Pagination queries
✅
✅
✅
Total count caching for pagination queries
✅
✅
❌
Pagination queries without SQL parsing (lighter weight and higher performance)
✅
❌
✅
Multi-table queries: FROM multiple tables
✅
❌
❌
Multi-table queries: LEFT JOIN, INNER JOIN, etc.
✅
❌
✅
Multi-table queries: UNION, UNION ALL
✅
❌
✅
Single primary key configuration
✅
✅
✅
Multiple ID generation strategies
✅
✅
✅
Supports multiple primary keys and composite primary keys
✅
❌
❌
Field typeHandler configuration
✅
✅
✅
No third-party dependencies other than MyBatis (lighter weight)
✅
❌
❌
Does QueryWrapper support RPC transmission in microservice projects?
✅
❌
Unknown
Logical deletion
✅
✅
✅
Optimistic locking
✅
✅
✅
SQL auditing
✅
❌
❌
Data filling
✅
✔️ (Paid)
✅
Data masking
✅
✔️ (Paid)
❌
Field-level permissions
✅
✔️ (Paid)
❌
Field encryption
✅
✔️ (Paid)
❌
Dictionary write-back
✅
✔️ (Paid)
❌
Db + Row
✅
❌
❌
Entity listeners
✅
❌
❌
Multiple data source support
✅
Requires other frameworks or paid features
❌
Do multiple data sources support Spring transaction management, such as @Transactional and TransactionTemplate?
✅
❌
❌
Do multiple data sources support non-Spring projects?
✅
❌
❌
Multi-Tenant
✅
✅
❌
Dynamic table names
✅
✅
❌
Dynamic Schema
✅
❌
❌
The above information comes from official documentation of related third-party products or third-party platforms. Corrections are welcome if anything is inaccurate.