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)); } }