mirror of
https://gitee.com/best_handsome/mybatis-plus-join
synced 2025-07-11 00:02:22 +08:00
新增toChildren方法
This commit is contained in:
parent
b6098167c6
commit
7c9e77f828
@ -0,0 +1,9 @@
|
||||
package com.github.yulichang.toolkit;
|
||||
|
||||
/**
|
||||
* @author yulichang
|
||||
* @since 1.4.7.2
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class Ref<T> {
|
||||
}
|
@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.core.toolkit.sql.StringEscape;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.github.yulichang.toolkit.LambdaUtils;
|
||||
import com.github.yulichang.toolkit.MPJSqlInjectionUtils;
|
||||
import com.github.yulichang.toolkit.Ref;
|
||||
import com.github.yulichang.toolkit.TableList;
|
||||
import com.github.yulichang.toolkit.sql.SqlScriptUtils;
|
||||
import com.github.yulichang.wrapper.enums.PrefixEnum;
|
||||
@ -24,6 +25,8 @@ import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.BiPredicate;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static com.baomidou.mybatisplus.core.enums.SqlKeyword.*;
|
||||
import static com.baomidou.mybatisplus.core.enums.WrapperKeyword.APPLY;
|
||||
@ -141,6 +144,21 @@ public abstract class MPJAbstractWrapper<T, Children extends MPJAbstractWrapper<
|
||||
return typedThis;
|
||||
}
|
||||
|
||||
/**
|
||||
* 转为子类,方便自定义继承扩展
|
||||
*/
|
||||
public <C extends Children> C toChildren(Ref<C> children) {
|
||||
return (C) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 转为子类,方便自定义继承扩展
|
||||
* 需要子类自定义字段
|
||||
*/
|
||||
public <C extends Children> C toChildren(Supplier<C> s) {
|
||||
return (C) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启检查 SQL 注入
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user