From 1297f582afd1b7c912c24ee855323e7a11ad0f67 Mon Sep 17 00:00:00 2001 From: nieqiurong Date: Fri, 19 Jul 2024 16:47:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B9=90=E8=A7=82=E9=94=81.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/baomidou/mybatis-plus-doc/issues/378 --- src/content/docs/plugins/optimistic-locker.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/content/docs/plugins/optimistic-locker.md b/src/content/docs/plugins/optimistic-locker.md index 9c99d33f..db7553a8 100755 --- a/src/content/docs/plugins/optimistic-locker.md +++ b/src/content/docs/plugins/optimistic-locker.md @@ -70,7 +70,8 @@ public class YourEntity { - 支持的数据类型包括:`int`, `Integer`, `long`, `Long`, `Date`, `Timestamp`, `LocalDateTime`。 - 对于整数类型,`newVersion` 是 `oldVersion + 1`。 - `newVersion` 会自动回写到实体对象中。 -- 仅支持 `updateById(id)` 和 `update(entity, wrapper)` 方法。 +- 支持内置的 `updateById(entity)` 和 `update(entity, wrapper)`, `saveOrUpdate(entity)`, `insertOrUpdate(entity) (version >=3.5.7)` 方法。 +- 自定义方法更新时如果满足内置参数的参数条件方式也会执行乐观锁逻辑,例如自定义`myUpate(entity)` 这个和 `updateById(entity)` 是等价的,会提取参数进行乐观锁填充,但更新实现需要自行处理。 - 在 `update(entity, wrapper)` 方法中,`wrapper` 不能复用。 ## 示例