Backend Development 6 min read

What’s New in MyBatis‑Plus for Spring Boot 3? Explore the Latest Features and Fixes

Version 3.5.4‑SNAPSHOT of MyBatis‑Plus introduces auto‑increment primary key handling, generic extraction, new BaseMapper update and streaming query methods, batch operations, expanded Spring Boot 3 support, numerous dependency upgrades, and a series of optimizations and bug fixes that improve performance, compatibility, and developer ergonomics.

Java Architecture Diary
Java Architecture Diary
Java Architecture Diary
What’s New in MyBatis‑Plus for Spring Boot 3? Explore the Latest Features and Fixes
<code><!--快照版本,SpringBoot3 将使用如下Maven坐标-->
<dependency>
    <groupId>com.baomidou</groupId>
    <artifactId>mybatis-plus-spring-boot3-starter</artifactId>
    <version>3.5.4-SNAPSHOT</version>
</dependency>
</code>

New Features

Added support for inserting null values into auto‑increment primary key fields, controllable via Insert(boolean ignoreAutoIncrementColumn) or Insert(String name, boolean ignoreAutoIncrementColumn) .

Built‑in generic extraction now works in non‑Spring projects.

BaseMapper gains an update(wrapper) method.

BaseMapper adds streaming query methods for large‑data handling.

<code>void selectBatchIds(@Param(Constants.COLL) Collection<? extends Serializable> idList, ResultHandler<T> resultHandler);
void selectByMap(Map<String, Object> columnMap, ResultHandler<T> resultHandler);
void selectList(@Param(Constants.WRAPPER) Wrapper<T> queryWrapper, ResultHandler<T> resultHandler);
void selectList(IPage<T> page, @Param(Constants.WRAPPER) Wrapper<T> queryWrapper, ResultHandler<T> resultHandler);
void selectMaps(@Param(Constants.WRAPPER) Wrapper<T> queryWrapper, ResultHandler<Map<String, Object>> resultHandler);
void selectMaps(IPage<? extends Map<String, Object>> page, @Param(Constants.WRAPPER) Wrapper<T> queryWrapper, ResultHandler<Map<String, Object>> resultHandler);
void selectObjs(@Param(Constants.WRAPPER) Wrapper<T> queryWrapper, ResultHandler<E> resultHandler);
//使用示例
baseMapper.selectList(page, Wrappers.emptyWrapper(), resultContext -> System.out.println(resultContext.getResultObject()));
</code>

Introduced batch operation handling methods.

<code>MybatisBatch.Method<H2User> mapperMethod = new MybatisBatch.Method<>(H2UserMapper.class);
List<BatchResult> batchResults = MybatisBatchUtils.execute(sqlSessionFactory, h2UserList, mapperMethod.insert());
</code>

Code generator metadata now exposes tableName and columnName fields.

Added mybatis-plus-spring-boot3-starter and its test module for Spring Boot 3 compatibility.

Plugin default injection now automatically registers InnerInterceptor when no MybatisPlusInterceptor is provided.

Upgraded source JDK version to Java 21.

Upgraded Gradle wrapper to 8.4‑rc‑1.

Upgraded Kotlin Gradle plugin to 1.9.20‑Beta.

Upgraded Spring Boot 2.x to 2.7.15.

Upgraded Lombok to 1.18.30.

Optimizations

Made mybatis-spring dependency in mybatis-plus-extension optional.

Reduced unnecessary configuration prompts in spring-boot-starter .

Field fill processor extraction now removes fixed‑parameter extraction, supporting more flexible mapper method parameters.

<code>void testMyMethod1(@Param("coll") List<User> userList);
void testMyMethod2(@Param("list") List<User> userList);
void testMyMethod3(@Param("collection") List<User> userList);
void testMyMethod4(List<User> userList);
// 新版本开始支持,还可以有多参数.
void testMyMethod5(@Param("userList") List<User> userList);
</code>

Removed calls to ReflectionKit.setAccessible to avoid issues with newer JDKs.

Adjusted selectOne to work with streaming, limiting to two rows and suppressing total‑record logs.

Optimized selectObjs return type to reduce casting.

ActiveRecord deleteById (logical delete) now supports automatic filling.

Bug Fixes

Fixed SQL error when Insert is called without fields.

Resolved lambda debugging issue on high‑version JDKs in IDEA.

Fixed warnings for select , groupBy , orderBy , orderByAsc , orderByDesc in LambdaQuery and added corresponding doXxx methods for overriding.

Fixed missing configuration warning for inject-sql-session-on-mapper-scan .

Corrected ordering error when using @OrderBy with @TableId .

Fixed type mismatch error during logical delete by primary key in Service.

Resolved conflict between pagination plugin Count and custom ResultHandler.

Fixed potential re‑entrancy issue in field fill processor.

javaBackend DevelopmentORMMyBatis-PlusSpring Boot 3
Java Architecture Diary
Written by

Java Architecture Diary

Committed to sharing original, high‑quality technical articles; no fluff or promotional content.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.