From 6224140cc1ec5985cf4fabb91659b14fbcac5982 Mon Sep 17 00:00:00 2001 From: yulichang <570810310@qq.com> Date: Fri, 24 May 2024 04:09:00 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E7=AE=80=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wrapper/interfaces/UpdateChain.java | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/interfaces/UpdateChain.java b/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/interfaces/UpdateChain.java index 30fb8eb..a7bee40 100644 --- a/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/interfaces/UpdateChain.java +++ b/mybatis-plus-join-core/src/main/java/com/github/yulichang/wrapper/interfaces/UpdateChain.java @@ -1,7 +1,5 @@ package com.github.yulichang.wrapper.interfaces; -import com.baomidou.mybatisplus.core.toolkit.Assert; -import com.github.yulichang.base.MPJBaseMapper; import com.github.yulichang.interfaces.MPJBaseJoin; import com.github.yulichang.toolkit.SqlHelper; @@ -28,10 +26,7 @@ public interface UpdateChain { * JoinWrappers.update(User.class)
*/ default int update() { - return SqlHelper.exec(getEntityClass(), mapper -> { - Assert.isTrue(mapper instanceof MPJBaseMapper, "mapper <%s> is not extends MPJBaseMapper", mapper.getClass().getSimpleName()); - return ((MPJBaseMapper) mapper).updateJoin(null, (MPJBaseJoin) this); - }); + return SqlHelper.exec(getEntityClass(), mapper -> mapper.updateJoin(null, (MPJBaseJoin) this)); } /** @@ -42,10 +37,7 @@ public interface UpdateChain { * JoinWrappers.update(User.class)
*/ default int update(T entity) { - return SqlHelper.exec(getEntityClass(), mapper -> { - Assert.isTrue(mapper instanceof MPJBaseMapper, "mapper <%s> is not extends MPJBaseMapper", mapper.getClass().getSimpleName()); - return ((MPJBaseMapper) mapper).updateJoin(entity, (MPJBaseJoin) this); - }); + return SqlHelper.exec(getEntityClass(), mapper -> mapper.updateJoin(entity, (MPJBaseJoin) this)); } /** @@ -56,10 +48,7 @@ public interface UpdateChain { * JoinWrappers.update(User.class)
*/ default int updateAndNull() { - return SqlHelper.exec(getEntityClass(), mapper -> { - Assert.isTrue(mapper instanceof MPJBaseMapper, "mapper <%s> is not extends MPJBaseMapper", mapper.getClass().getSimpleName()); - return ((MPJBaseMapper) mapper).updateJoinAndNull(null, (MPJBaseJoin) this); - }); + return SqlHelper.exec(getEntityClass(), mapper -> mapper.updateJoinAndNull(null, (MPJBaseJoin) this)); } /** @@ -70,9 +59,6 @@ public interface UpdateChain { * JoinWrappers.update(User.class)
*/ default int updateAndNull(T entity) { - return SqlHelper.exec(getEntityClass(), mapper -> { - Assert.isTrue(mapper instanceof MPJBaseMapper, "mapper <%s> is not extends MPJBaseMapper", mapper.getClass().getSimpleName()); - return ((MPJBaseMapper) mapper).updateJoinAndNull(entity, (MPJBaseJoin) this); - }); + return SqlHelper.exec(getEntityClass(), mapper -> mapper.updateJoinAndNull(entity, (MPJBaseJoin) this)); } }