This commit is contained in:
admin 2021-02-27 14:50:27 +08:00
parent 332f21bb6d
commit 1debe1d825
2 changed files with 11 additions and 12 deletions

View File

@ -45,6 +45,6 @@ public class F {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static <T> Class<T> getEntityClass(SFunction<T, ?> fn) { public static <T> Class<T> getEntityClass(SFunction<T, ?> fn) {
return (Class<T>) com.baomidou.mybatisplus.core.toolkit.LambdaUtils.resolve(fn).getInstantiatedType(); return (Class<T>) LambdaUtils.resolve(fn).getInstantiatedType();
} }
} }

View File

@ -25,33 +25,32 @@ import java.util.Objects;
public class S { public class S {
public static <T, R> String a(SFunction<T, R> sFunction) { public static <T, R> String a(SFunction<T, R> sFunction) {
Assert.notNull(sFunction, "function is null"); return getStrByAlias("a", sFunction);
return "a" + StringPool.DOT + getColumn(sFunction);
} }
public static <T, R> String b(SFunction<T, R> sFunction) { public static <T, R> String b(SFunction<T, R> sFunction) {
Assert.notNull(sFunction, "function is null"); return getStrByAlias("b", sFunction);
return "b" + StringPool.DOT + getColumn(sFunction);
} }
public static <T, R> String c(SFunction<T, R> sFunction) { public static <T, R> String c(SFunction<T, R> sFunction) {
Assert.notNull(sFunction, "function is null"); return getStrByAlias("c", sFunction);
return "c" + StringPool.DOT + getColumn(sFunction);
} }
public static <T, R> String d(SFunction<T, R> sFunction) { public static <T, R> String d(SFunction<T, R> sFunction) {
Assert.notNull(sFunction, "function is null"); return getStrByAlias("d", sFunction);
return "d" + StringPool.DOT + getColumn(sFunction);
} }
public static <T, R> String e(SFunction<T, R> sFunction) { public static <T, R> String e(SFunction<T, R> sFunction) {
Assert.notNull(sFunction, "function is null"); return getStrByAlias("e", sFunction);
return "e" + StringPool.DOT + getColumn(sFunction);
} }
public static <T, R> String f(SFunction<T, R> sFunction) { public static <T, R> String f(SFunction<T, R> sFunction) {
return getStrByAlias("f", sFunction);
}
private static <T, R> String getStrByAlias(String alias, SFunction<T, R> sFunction) {
Assert.notNull(sFunction, "function is null"); Assert.notNull(sFunction, "function is null");
return "f" + StringPool.DOT + getColumn(sFunction); return alias + StringPool.DOT + getColumn(sFunction);
} }
/** /**