DynClassDepends
This commit is contained in:
@@ -8,7 +8,6 @@ package org.redkale.annotation;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
import java.lang.annotation.*;
|
||||
import static java.lang.annotation.ElementType.*;
|
||||
import org.redkale.asm.AsmDepends;
|
||||
|
||||
/**
|
||||
* 类似java.beans.ConstructorProperties, 必须配合Creator使用
|
||||
@@ -21,7 +20,7 @@ import org.redkale.asm.AsmDepends;
|
||||
@Documented
|
||||
@Target({METHOD, CONSTRUCTOR})
|
||||
@Retention(RUNTIME)
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public @interface ConstructorParameters {
|
||||
|
||||
String[] value();
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package org.redkale.asm;
|
||||
package org.redkale.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
import static java.lang.annotation.ElementType.*;
|
||||
import static java.lang.annotation.RetentionPolicy.*;
|
||||
|
||||
/**
|
||||
* 被标记的元素表示会被asm动态字节码调用到
|
||||
* 被标记的元素表示会被动态字节码调用
|
||||
*
|
||||
* <p>
|
||||
* 详情见: https://redkale.org
|
||||
@@ -20,7 +20,7 @@ import static java.lang.annotation.RetentionPolicy.*;
|
||||
@Documented
|
||||
@Target({TYPE, METHOD, FIELD})
|
||||
@Retention(SOURCE)
|
||||
public @interface AsmDepends {
|
||||
public @interface DynClassDepends {
|
||||
|
||||
Class[] value() default {};
|
||||
}
|
||||
@@ -10,13 +10,13 @@ import java.util.Objects;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import org.redkale.annotation.Nullable;
|
||||
import org.redkale.annotation.Resource;
|
||||
import org.redkale.asm.AsmDepends;
|
||||
import org.redkale.cache.CacheManager;
|
||||
import org.redkale.convert.json.JsonConvert;
|
||||
import org.redkale.util.Environment;
|
||||
import org.redkale.util.MultiHashKey;
|
||||
import org.redkale.util.ThrowSupplier;
|
||||
import org.redkale.util.TypeToken;
|
||||
import org.redkale.annotation.DynClassDepends;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -29,7 +29,7 @@ import org.redkale.util.TypeToken;
|
||||
*
|
||||
* @since 2.8.0
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public class CacheAction {
|
||||
|
||||
@Resource
|
||||
@@ -102,7 +102,7 @@ public class CacheAction {
|
||||
this.remoteExpire = createDuration(cached.getRemoteExpire());
|
||||
}
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public <T> T get(ThrowSupplier<T> supplier, Object... args) {
|
||||
if (async) {
|
||||
ThrowSupplier supplier0 = supplier;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
package org.redkale.convert;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import org.redkale.asm.AsmDepends;
|
||||
import org.redkale.annotation.DynClassDepends;
|
||||
|
||||
/**
|
||||
* 反序列化操作类
|
||||
@@ -18,7 +18,7 @@ import org.redkale.asm.AsmDepends;
|
||||
* @param <R> Reader输入的子类
|
||||
* @param <T> 反解析的数据类型
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public interface Decodeable<R extends Reader, T> {
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
package org.redkale.convert;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import org.redkale.asm.AsmDepends;
|
||||
import org.redkale.annotation.DynClassDepends;
|
||||
|
||||
/**
|
||||
* 序列化操作类
|
||||
@@ -18,7 +18,7 @@ import org.redkale.asm.AsmDepends;
|
||||
* @param <W> Writer输出的子类
|
||||
* @param <T> 序列化的数据类型
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public interface Encodeable<W extends Writer, T> {
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,8 +7,8 @@ package org.redkale.convert;
|
||||
|
||||
import java.lang.reflect.*;
|
||||
import java.util.function.*;
|
||||
import org.redkale.asm.AsmDepends;
|
||||
import org.redkale.util.*;
|
||||
import org.redkale.annotation.DynClassDepends;
|
||||
|
||||
/**
|
||||
* 序列化的数据输出流
|
||||
@@ -131,7 +131,7 @@ public abstract class Writer {
|
||||
*
|
||||
* @param clazz 对象的类名
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public final void writeObjectNull(final Class clazz) {
|
||||
writeClassName(null);
|
||||
writeNull();
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
package org.redkale.convert.json;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import org.redkale.asm.AsmDepends;
|
||||
import org.redkale.convert.*;
|
||||
import org.redkale.annotation.DynClassDepends;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -29,7 +29,7 @@ public abstract class JsonWriter extends Writer {
|
||||
return (JsonWriter) super.withFeatures(features);
|
||||
}
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public boolean isExtFuncEmpty() {
|
||||
return this.objExtFunc == null && this.objFieldFunc == null;
|
||||
}
|
||||
@@ -49,57 +49,57 @@ public abstract class JsonWriter extends Writer {
|
||||
* @param quote 是否加双引号
|
||||
* @param value 非null且不含需要转义的字符的String值
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public abstract void writeLatin1To(final boolean quote, final String value);
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public abstract void writeFieldShortValue(final byte[] fieldBytes, final short value);
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public abstract void writeFieldIntValue(final byte[] fieldBytes, final int value);
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public abstract void writeFieldLongValue(final byte[] fieldBytes, final long value);
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public abstract void writeFieldLatin1Value(final byte[] fieldBytes, final String value);
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public abstract void writeLastFieldShortValue(final byte[] fieldBytes, final short value);
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public abstract void writeLastFieldIntValue(final byte[] fieldBytes, final int value);
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public abstract void writeLastFieldLongValue(final byte[] fieldBytes, final long value);
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public abstract void writeLastFieldLatin1Value(final byte[] fieldBytes, final String value);
|
||||
|
||||
//firstFieldBytes 必须带{开头
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public abstract void writeObjectByOnlyOneLatin1FieldValue(final byte[] firstFieldBytes, final String value);
|
||||
|
||||
//firstFieldBytes 必须带{开头, lastFieldBytes必须,开头
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public abstract void writeObjectByOnlyTwoIntFieldValue(final byte[] firstFieldBytes, final int value1, final byte[] lastFieldBytes, final int value2);
|
||||
|
||||
@Override
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public abstract void writeBoolean(boolean value);
|
||||
|
||||
@Override
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public abstract void writeInt(int value);
|
||||
|
||||
@Override
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public abstract void writeLong(long value);
|
||||
|
||||
public abstract void writeString(final boolean quote, String value);
|
||||
|
||||
@Override
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public abstract void writeString(String value);
|
||||
|
||||
@Override //只容许JsonBytesWriter重写此方法
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
package org.redkale.mq;
|
||||
|
||||
import org.redkale.annotation.Component;
|
||||
import org.redkale.asm.AsmDepends;
|
||||
import org.redkale.service.Local;
|
||||
import org.redkale.util.AnyValue;
|
||||
import org.redkale.annotation.DynClassDepends;
|
||||
|
||||
/**
|
||||
* MQ消费器, 实现类必须标记{@link org.redkale.mq.ResourceConsumer}
|
||||
@@ -21,7 +21,7 @@ import org.redkale.util.AnyValue;
|
||||
*/
|
||||
@Local
|
||||
@Component
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public interface MessageConsumer<T> {
|
||||
|
||||
default void init(AnyValue config) {
|
||||
|
||||
@@ -6,8 +6,8 @@ package org.redkale.mq;
|
||||
import java.lang.annotation.*;
|
||||
import static java.lang.annotation.ElementType.TYPE;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
import org.redkale.asm.AsmDepends;
|
||||
import org.redkale.convert.ConvertType;
|
||||
import org.redkale.annotation.DynClassDepends;
|
||||
|
||||
/**
|
||||
* MQ资源注解, 只能标记在{@link org.redkale.mq.MessageConsumer}子类上
|
||||
@@ -19,7 +19,7 @@ import org.redkale.convert.ConvertType;
|
||||
*
|
||||
* @since 2.8.0
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
@Documented
|
||||
@Target({TYPE})
|
||||
@Retention(RUNTIME)
|
||||
|
||||
@@ -14,13 +14,13 @@ import java.util.*;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.logging.Level;
|
||||
import org.redkale.annotation.Comment;
|
||||
import org.redkale.asm.AsmDepends;
|
||||
import org.redkale.convert.*;
|
||||
import org.redkale.convert.json.JsonConvert;
|
||||
import org.redkale.net.Request;
|
||||
import org.redkale.util.*;
|
||||
import static org.redkale.util.Utility.isEmpty;
|
||||
import static org.redkale.util.Utility.isNotEmpty;
|
||||
import org.redkale.annotation.DynClassDepends;
|
||||
|
||||
/**
|
||||
* Http请求包 与javax.servlet.http.HttpServletRequest 基本类似。 <br>
|
||||
@@ -1181,7 +1181,7 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
*
|
||||
* @since 2.4.0
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
@SuppressWarnings("unchecked")
|
||||
public int currentIntUserid() {
|
||||
if (currentUserid == CURRUSERID_NIL || currentUserid == null) {
|
||||
@@ -1201,7 +1201,7 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
*
|
||||
* @since 2.7.0
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
@SuppressWarnings("unchecked")
|
||||
public long currentLongUserid() {
|
||||
if (currentUserid == CURRUSERID_NIL || currentUserid == null) {
|
||||
@@ -1221,7 +1221,7 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
*
|
||||
* @since 2.8.0
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
@SuppressWarnings("unchecked")
|
||||
public String currentStringUserid() {
|
||||
if (currentUserid == CURRUSERID_NIL || currentUserid == null) {
|
||||
@@ -1240,7 +1240,7 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
*
|
||||
* @since 2.1.0
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends Serializable> T currentUserid(Class<T> type) {
|
||||
if (currentUserid == CURRUSERID_NIL || currentUserid == null) {
|
||||
@@ -2163,7 +2163,7 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
*
|
||||
* @return AnyValue
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public HttpHeaders getHeaders() {
|
||||
parseHeader();
|
||||
return headers;
|
||||
@@ -2199,7 +2199,7 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
*
|
||||
* @return header值
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public String getHeader(String name, String defaultValue) {
|
||||
parseHeader();
|
||||
return headers.firstValue(name, defaultValue);
|
||||
@@ -2214,7 +2214,7 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
*
|
||||
* @return header值
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public <T> T getJsonHeader(java.lang.reflect.Type type, String name) {
|
||||
String v = getHeader(name);
|
||||
return isEmpty(v) ? null : jsonConvert.convertFrom(type, v);
|
||||
@@ -2230,7 +2230,7 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
*
|
||||
* @return header值
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public <T> T getJsonHeader(JsonConvert convert, java.lang.reflect.Type type, String name) {
|
||||
String v = getHeader(name);
|
||||
return isEmpty(v) ? null : convert.convertFrom(type, v);
|
||||
@@ -2244,7 +2244,7 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
*
|
||||
* @return header值
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public boolean getBooleanHeader(String name, boolean defaultValue) {
|
||||
String value = getHeader(name);
|
||||
return isEmpty(value) ? defaultValue : Boolean.parseBoolean(value);
|
||||
@@ -2258,7 +2258,7 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
*
|
||||
* @return header值
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public short getShortHeader(String name, short defaultValue) {
|
||||
String value = getHeader(name);
|
||||
if (isEmpty(value)) {
|
||||
@@ -2280,7 +2280,7 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
*
|
||||
* @return header值
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public short getShortHeader(int radix, String name, short defaultValue) {
|
||||
String value = getHeader(name);
|
||||
if (isEmpty(value)) {
|
||||
@@ -2301,7 +2301,7 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
*
|
||||
* @return header值
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public short getShortHeader(String name, int defaultValue) {
|
||||
String value = getHeader(name);
|
||||
if (isEmpty(value)) {
|
||||
@@ -2323,7 +2323,7 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
*
|
||||
* @return header值
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public short getShortHeader(int radix, String name, int defaultValue) {
|
||||
String value = getHeader(name);
|
||||
if (isEmpty(value)) {
|
||||
@@ -2344,7 +2344,7 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
*
|
||||
* @return header值
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public int getIntHeader(String name, int defaultValue) {
|
||||
String value = getHeader(name);
|
||||
if (isEmpty(value)) {
|
||||
@@ -2366,7 +2366,7 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
*
|
||||
* @return header值
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public int getIntHeader(int radix, String name, int defaultValue) {
|
||||
String value = getHeader(name);
|
||||
if (isEmpty(value)) {
|
||||
@@ -2387,7 +2387,7 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
*
|
||||
* @return header值
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public long getLongHeader(String name, long defaultValue) {
|
||||
String value = getHeader(name);
|
||||
if (isEmpty(value)) {
|
||||
@@ -2409,7 +2409,7 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
*
|
||||
* @return header值
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public long getLongHeader(int radix, String name, long defaultValue) {
|
||||
String value = getHeader(name);
|
||||
if (isEmpty(value)) {
|
||||
@@ -2430,7 +2430,7 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
*
|
||||
* @return header值
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public float getFloatHeader(String name, float defaultValue) {
|
||||
String value = getHeader(name);
|
||||
if (isEmpty(value)) {
|
||||
@@ -2451,7 +2451,7 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
*
|
||||
* @return header值
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public double getDoubleHeader(String name, double defaultValue) {
|
||||
String value = getHeader(name);
|
||||
if (isEmpty(value)) {
|
||||
@@ -2470,7 +2470,7 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
*
|
||||
* @return AnyValue
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public HttpParameters getParameters() {
|
||||
parseBody();
|
||||
return params;
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.redkale.source.Flipper;
|
||||
import org.redkale.util.*;
|
||||
import org.redkale.util.RedkaleClassLoader.DynBytesClassLoader;
|
||||
import static org.redkale.util.Utility.isEmpty;
|
||||
import org.redkale.annotation.DynClassDepends;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -293,7 +294,7 @@ public final class Rest {
|
||||
}
|
||||
|
||||
//仅供Rest动态构建里 currentUserid() 使用
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public static <T> T orElse(T t, T defValue) {
|
||||
return t == null ? defValue : t;
|
||||
}
|
||||
|
||||
@@ -8,13 +8,13 @@ package org.redkale.net.sncp;
|
||||
import java.lang.reflect.Type;
|
||||
import java.nio.channels.CompletionHandler;
|
||||
import java.util.concurrent.*;
|
||||
import org.redkale.asm.AsmDepends;
|
||||
import org.redkale.convert.bson.BsonWriter;
|
||||
import org.redkale.net.Response;
|
||||
import static org.redkale.net.sncp.SncpHeader.KEEPALIVE_OFF;
|
||||
import static org.redkale.net.sncp.SncpHeader.KEEPALIVE_ON;
|
||||
import org.redkale.util.ByteArray;
|
||||
import org.redkale.util.Traces;
|
||||
import org.redkale.annotation.DynClassDepends;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -86,7 +86,7 @@ public class SncpResponse extends Response<SncpContext, SncpRequest> {
|
||||
return this;
|
||||
}
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public <T extends CompletionHandler> T getParamAsyncHandler() {
|
||||
return (T) this.paramAsyncHandler;
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.stream.Stream;
|
||||
import org.redkale.asm.AsmDepends;
|
||||
import org.redkale.util.LambdaFunction;
|
||||
import org.redkale.util.LambdaSupplier;
|
||||
import org.redkale.util.SelectColumn;
|
||||
import org.redkale.util.Sheet;
|
||||
import org.redkale.annotation.DynClassDepends;
|
||||
|
||||
/**
|
||||
* 类似Mybatis的Mapper接口类, 接口系列和DataSource相似度高 <br>
|
||||
@@ -39,7 +39,7 @@ public interface DataSqlMapper<T> {
|
||||
*
|
||||
* @return DataSqlSource
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
DataSqlSource dataSource();
|
||||
|
||||
/**
|
||||
@@ -48,7 +48,7 @@ public interface DataSqlMapper<T> {
|
||||
*
|
||||
* @return Class
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
Class<T> entityType();
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,9 +7,9 @@ import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.function.*;
|
||||
import org.redkale.asm.AsmDepends;
|
||||
import static org.redkale.source.DataResultSet.formatColumnValue;
|
||||
import org.redkale.util.*;
|
||||
import org.redkale.annotation.DynClassDepends;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -21,7 +21,7 @@ import org.redkale.util.*;
|
||||
* @author zhangjx
|
||||
* @since 2.8.0
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public interface DataSqlSource extends DataSource {
|
||||
|
||||
/**
|
||||
@@ -130,10 +130,10 @@ public interface DataSqlSource extends DataSource {
|
||||
*/
|
||||
public <V> CompletableFuture<V> nativeQueryAsync(String sql, BiConsumer<Object, Object> consumer, Function<DataResultSet, V> handler, Map<String, Object> params);
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public <V> Sheet<V> nativeQuerySheet(Class<V> type, String sql, Flipper flipper, Map<String, Object> params);
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public <V> CompletableFuture<Sheet<V>> nativeQuerySheetAsync(Class<V> type, String sql, Flipper flipper, Map<String, Object> params);
|
||||
|
||||
//----------------------------- 无参数 -----------------------------
|
||||
@@ -145,37 +145,37 @@ public interface DataSqlSource extends DataSource {
|
||||
return nativeQueryAsync(sql, null, handler);
|
||||
}
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
default <V> V nativeQueryOne(Class<V> type, String sql) {
|
||||
return nativeQuery(sql, rset -> EntityBuilder.getOneValue(type, rset));
|
||||
}
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
default <V> CompletableFuture<V> nativeQueryOneAsync(Class<V> type, String sql) {
|
||||
return nativeQueryAsync(sql, rset -> EntityBuilder.getOneValue(type, rset));
|
||||
}
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
default <V> List<V> nativeQueryList(Class<V> type, String sql) {
|
||||
return nativeQuery(sql, rset -> EntityBuilder.getListValue(type, rset));
|
||||
}
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
default <V> CompletableFuture<List<V>> nativeQueryListAsync(Class<V> type, String sql) {
|
||||
return nativeQueryAsync(sql, rset -> EntityBuilder.getListValue(type, rset));
|
||||
}
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
default <V> Sheet<V> nativeQuerySheet(Class<V> type, String sql, Flipper flipper) {
|
||||
return nativeQuerySheet(type, sql, flipper, Collections.emptyMap());
|
||||
}
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
default <V> CompletableFuture<Sheet<V>> nativeQuerySheetAsync(Class<V> type, String sql, Flipper flipper) {
|
||||
return nativeQuerySheetAsync(type, sql, flipper, Collections.emptyMap());
|
||||
}
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
default <K, V> Map<K, V> nativeQueryMap(Class<K> keyType, Class<V> valType, String sql) {
|
||||
return nativeQuery(sql, rset -> {
|
||||
Map<K, V> map = new LinkedHashMap<>();
|
||||
@@ -188,7 +188,7 @@ public interface DataSqlSource extends DataSource {
|
||||
});
|
||||
}
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
default <K, V> CompletableFuture<Map<K, V>> nativeQueryMapAsync(Class<K> keyType, Class<V> valType, String sql) {
|
||||
return nativeQueryAsync(sql, rset -> {
|
||||
Map<K, V> map = new LinkedHashMap<>();
|
||||
@@ -226,7 +226,7 @@ public interface DataSqlSource extends DataSource {
|
||||
return nativeQueryAsync(sql, null, handler, params);
|
||||
}
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
default <V> V nativeQueryOne(Class<V> type, String sql, Map<String, Object> params) {
|
||||
return nativeQuery(sql, rset -> {
|
||||
if (!rset.next()) {
|
||||
@@ -239,7 +239,7 @@ public interface DataSqlSource extends DataSource {
|
||||
}, params);
|
||||
}
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
default <V> CompletableFuture<V> nativeQueryOneAsync(Class<V> type, String sql, Map<String, Object> params) {
|
||||
return nativeQueryAsync(sql, rset -> {
|
||||
if (!rset.next()) {
|
||||
@@ -252,7 +252,7 @@ public interface DataSqlSource extends DataSource {
|
||||
}, params);
|
||||
}
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
default <V> List<V> nativeQueryList(Class<V> type, String sql, Map<String, Object> params) {
|
||||
return nativeQuery(sql, rset -> {
|
||||
if (EntityBuilder.isSimpleType(type)) {
|
||||
@@ -266,7 +266,7 @@ public interface DataSqlSource extends DataSource {
|
||||
}, params);
|
||||
}
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
default <V> CompletableFuture<List<V>> nativeQueryListAsync(Class<V> type, String sql, Map<String, Object> params) {
|
||||
return nativeQueryAsync(sql, rset -> {
|
||||
if (EntityBuilder.isSimpleType(type)) {
|
||||
@@ -280,7 +280,7 @@ public interface DataSqlSource extends DataSource {
|
||||
}, params);
|
||||
}
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
default <K, V> Map<K, V> nativeQueryMap(Class<K> keyType, Class<V> valType, String sql, Map<String, Object> params) {
|
||||
return nativeQuery(sql, rset -> {
|
||||
Map<K, V> map = new LinkedHashMap<>();
|
||||
@@ -293,7 +293,7 @@ public interface DataSqlSource extends DataSource {
|
||||
}, params);
|
||||
}
|
||||
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
default <K, V> CompletableFuture<Map<K, V>> nativeQueryMapAsync(Class<K> keyType, Class<V> valType, String sql, Map<String, Object> params) {
|
||||
return nativeQueryAsync(sql, rset -> {
|
||||
Map<K, V> map = new LinkedHashMap<>();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
package org.redkale.util;
|
||||
|
||||
import org.redkale.asm.AsmDepends;
|
||||
import org.redkale.annotation.DynClassDepends;
|
||||
|
||||
/**
|
||||
* 抛异常版的Supplier
|
||||
@@ -16,7 +16,7 @@ import org.redkale.asm.AsmDepends;
|
||||
*
|
||||
* @since 2.8.0
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
@FunctionalInterface
|
||||
public interface ThrowSupplier<T> {
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ import java.util.stream.Stream;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
import javax.crypto.*;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import org.redkale.asm.AsmDepends;
|
||||
import org.redkale.convert.json.JsonConvert;
|
||||
import org.redkale.annotation.DynClassDepends;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -1545,7 +1545,7 @@ public final class Utility {
|
||||
*
|
||||
* @return Map
|
||||
*/
|
||||
@AsmDepends
|
||||
@DynClassDepends
|
||||
public static <K, V> HashMap<K, V> ofMap(Object... items) {
|
||||
HashMap<K, V> map = new LinkedHashMap<>(Math.max(1, items.length / 2));
|
||||
int len = items.length / 2;
|
||||
@@ -3441,7 +3441,7 @@ public final class Utility {
|
||||
*
|
||||
* @return 对象
|
||||
*/
|
||||
@AsmDepends(Copier.class)
|
||||
@DynClassDepends(Copier.class)
|
||||
public static <T> T convertValue(Type type, Object value) {
|
||||
if (type == null || value == null) {
|
||||
return (T) value;
|
||||
|
||||
Reference in New Issue
Block a user