What’s New in MyBatis‑Plus 3.5.13? Top Features and Performance Boosts
MyBatis‑Plus 3.5.13 introduces dynamic SQL smart optimization, a richer code generator, significant heap‑memory reduction, Spring Boot 3 and JDK 17 native support, new database adapters, enhanced optimistic locking, multi‑parameter filling, and comprehensive SQL‑injection safeguards, all aimed at faster, more productive backend development.
MyBatis‑Plus is an enhancement toolkit for MyBatis that simplifies CRUD operations by injecting single‑table SQL when loading XML configuration, boosting development productivity with dynamic SQL scripts and better performance.
Demo examples: https://gitee.com/baomidou/mybatis-plus-samples
Official documentation: https://baomidou.com/
Comparison with Similar Frameworks
MyBatis‑Plus avoids meaningless comparisons and does not exaggerate its advantages; it encourages objective, fair comparisons so users can experience the differences themselves.
Key Features of the Current Version
Dynamic SQL smart optimization with local cache acceleration and enhanced tenant‑aware XML dynamic SQL support.
Code generator now supports more custom features; see test cases for details.
Significant reduction of heap memory usage and faster startup by streamlining dynamic SQL parsing and injection (over 40% memory saved in tests with ~500 tables).
Improved Spring Boot 3 + JDK 17 native build support (Lambda methods not yet supported).
Added support for XingRuiGe (星瑞格) database (other domestic databases welcome PRs).
Upgraded MyBatis to version 3.5.13.
Optimistic lock now supports java.time.Instant for built‑in SQL execution.
Wrapper now supports TypeHandler type conversion and dynamic mapping of other SQL parameters.
DDL script maintenance now supports stored‑procedure execution and custom delimiters.
Parameter filler now supports multi‑parameter filling.
Enhanced SQL injection detection and handling methods.
Upgrade Log Highlights
feat: Upgrade MyBatis to 3.5.13, MyBatis‑Spring to 2.1.1.
feat: JSqlParser provides unified parsing class with configurable functions and cache options.
feat: Add Sequence initialization debug logs.
feat: Parameter filler supports multi‑parameter filling.
feat: BaseMapper adds selectMaps(page, wrapper) and selectList(page, wrapper) methods.
feat: Optimistic lock field now supports java.time.Instant .
feat: wrapper#apply supports mapping configuration, e.g., column={0,javaType=int,jdbcType=NUMERIC,typeHandler=xxx.xxx.MyTypeHandler} .
feat: Adjust QueryWrapper to require explicit SQL‑injection check (removing automatic order‑by filtering).
feat: Add support for XingRuiGe database.
feat: updateWrapper#setSql now supports dynamic parameters (see wrapper#apply ).
feat: Automatic SQL DDL maintenance now supports stored‑procedure execution.
perf: Strengthen generic constraints for ktWrapper .
fix: Resolve entity description errors when selecting SpringDoc documentation comments.
fix: Correct SQL generation errors for IdType AUTO in Table#getAllInsertSqlColumnMaybeIf .
fix: Tenant plugin now supports update set subSelect scenarios.
fix: Address illegal reflective access warnings on high‑version JDKs.
fix: Resolve dynamic proxy reflection errors on high‑version JDKs.
fix: Correct path replacement that mistakenly turned '.' into file separators.
fix: Fix Beetl template engine comment generation issues.
fix: Resolve mapping issues for Types.DOUBLE .
fix: Correct errors when converting public fields of parent classes.
fix: Resolve generator failures when accessing configuration values via cfg .
fix: Fix transaction rollback failures with MockBean in unit tests.
fix: Correct naming inconsistencies in Warpper.nonEmptyOfWhere causing OGNL cache overhead.
fix: ClickHouseQuery tableComment() now correctly returns the comment field.
opt: Enhance parameter filler to prevent type mismatches when names coincide.
opt: Remove injection of SelectPage, SelectMapsPage, SelectByMap, DeleteByMap methods.
opt: Reduce MappedStatement heap memory consumption.
opt: Solve performance overhead caused by repeated PluginUtils metadata retrieval.
opt: Clean up unnecessary line breaks in injected methods.
opt: Remove SqlRunner’s retained sqlSessionFactory variable.
opt: Fix multiple Sequence initialization issues when custom generators are used.
opt: Optimize generic return type of SqlHelper#getMapper .
docs: Correct DdlHelper documentation errors.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java Architecture Diary
Committed to sharing original, high‑quality technical articles; no fluff or promotional content.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
