Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
500545fc93 | ||
|
|
78f1bd90f4 | ||
|
|
f5a04319d5 | ||
|
|
76ce6787d1 | ||
|
|
bd53d4a8ab | ||
|
|
53b11116b9 | ||
|
|
734b1bbbb4 | ||
|
|
f014bffb6c |
@@ -608,7 +608,7 @@ public final class Application {
|
||||
runServers(timecd, others);
|
||||
runServers(timecd, watchs); //必须在所有服务都启动后再启动WATCH服务
|
||||
timecd.await();
|
||||
if (!singletonrun) signalHandle();
|
||||
//if (!singletonrun) signalHandle();
|
||||
if (!singletonrun) clearPersistData();
|
||||
logger.info(this.getClass().getSimpleName() + " started in " + (System.currentTimeMillis() - startTime) + " ms\r\n");
|
||||
if (!singletonrun) this.serversLatch.await();
|
||||
@@ -645,7 +645,10 @@ public final class Application {
|
||||
}
|
||||
};
|
||||
for (Signal sig : list) {
|
||||
Signal.handle(sig, handler);
|
||||
try {
|
||||
Signal.handle(sig, handler);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -882,7 +882,7 @@ public final class Rest {
|
||||
}
|
||||
}
|
||||
av0 = mv.visitAnnotation(mappingDesc, true);
|
||||
String url = (catalog.isEmpty() ? "/" : ("/" + catalog + "/")) + defmodulename.toLowerCase() + "/" + entry.name + (reqpath ? "/" : "");
|
||||
String url = (catalog.isEmpty() ? "/" : ("/" + catalog + "/")) + defmodulename + "/" + entry.name + (reqpath ? "/" : "");
|
||||
av0.visit("url", url);
|
||||
av0.visit("auth", entry.auth);
|
||||
av0.visit("cacheseconds", entry.cacheseconds);
|
||||
|
||||
@@ -38,6 +38,8 @@ public abstract class WebSocketNode {
|
||||
|
||||
protected final boolean finest = logger.isLoggable(Level.FINEST);
|
||||
|
||||
protected final boolean finer = logger.isLoggable(Level.FINER);
|
||||
|
||||
//"SNCP_ADDR" 如果不是分布式(没有SNCP) 值为null
|
||||
@Resource(name = Application.RESNAME_SNCP_ADDR)
|
||||
protected InetSocketAddress localSncpAddress; //为SncpServer的服务address
|
||||
@@ -427,8 +429,11 @@ public abstract class WebSocketNode {
|
||||
//远程节点发送消息
|
||||
CompletableFuture<Collection<InetSocketAddress>> addrsFuture = sncpNodeAddresses.getCollectionAsync(userid);
|
||||
CompletableFuture<Integer> remoteFuture = addrsFuture.thenCompose((Collection<InetSocketAddress> addrs) -> {
|
||||
if (addrs == null || addrs.isEmpty()) {
|
||||
if (finer) logger.finer("websocket not found userid:" + userid + " on any node ");
|
||||
return CompletableFuture.completedFuture(0);
|
||||
}
|
||||
if (finest) logger.finest("websocket found userid:" + userid + " on " + addrs);
|
||||
if (addrs == null || addrs.isEmpty()) return CompletableFuture.completedFuture(0);
|
||||
CompletableFuture<Integer> future = null;
|
||||
for (InetSocketAddress addr : addrs) {
|
||||
if (addr == null || addr.equals(localSncpAddress)) continue;
|
||||
|
||||
@@ -183,7 +183,7 @@ public final class WebSocketPacket {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.getClass().getSimpleName() + "[type=" + type + ", last=" + last + (payload != null ? (", payload=" + payload) : "") + (bytes != null ? (", bytes=[" + bytes.length + ']') : "") + (sendJson != null ? (", json=" + sendJson) : "") + "]";
|
||||
return this.getClass().getSimpleName() + "[type=" + type + ", last=" + last + (payload != null ? (", payload=" + payload) : "") + (bytes != null ? (", bytes=[" + bytes.length + ']') : "") + (sendJson != null ? (", json=" + (mapconvable ? Utility.ofMap((Object[]) sendJson) : sendJson)) : "") + "]";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -211,7 +211,7 @@ public final class WebSocketPacket {
|
||||
return supplier.get();
|
||||
}
|
||||
};
|
||||
ByteBuffer[] buffers = this.mapconvable ? this.sendConvert.convertMapTo(supplier, (Object[]) sendJson) : this.sendConvert.convertTo(newsupplier, sendJson);
|
||||
ByteBuffer[] buffers = this.mapconvable ? this.sendConvert.convertMapTo(newsupplier, (Object[]) sendJson) : this.sendConvert.convertTo(newsupplier, sendJson);
|
||||
int len = 0;
|
||||
for (ByteBuffer buf : buffers) {
|
||||
len += buf.remaining();
|
||||
|
||||
@@ -10,8 +10,9 @@ import static java.lang.annotation.ElementType.*;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
/**
|
||||
* 本地模式注解。
|
||||
* 声明为Local的Service只能以本地模式存在, 即使配置文件中配置成远程模式也将被忽略。
|
||||
* 本地模式注解。<br>
|
||||
* 声明为Local的Service只能以本地模式存在, 即使配置文件中配置成远程模式也将被忽略。 <br>
|
||||
* Service里被标记为Local的public方法不会被重载。
|
||||
*
|
||||
* <p>
|
||||
* 详情见: https://redkale.org
|
||||
|
||||
@@ -13,6 +13,7 @@ import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.function.*;
|
||||
import java.util.logging.*;
|
||||
import java.util.stream.Stream;
|
||||
import javax.annotation.Resource;
|
||||
import org.redkale.service.*;
|
||||
import static org.redkale.source.DataSources.*;
|
||||
@@ -448,7 +449,7 @@ public class DataJdbcSource extends AbstractService implements DataSource, DataC
|
||||
}
|
||||
String sql = "DELETE " + (this.readPool.isMysql() ? "a" : "") + " FROM " + info.getTable(node) + " a" + (join1 == null ? "" : (", " + join1))
|
||||
+ ((where == null || where.length() == 0) ? (join2 == null ? "" : (" WHERE " + join2))
|
||||
: (" WHERE " + where + (join2 == null ? "" : (" AND " + join2)))) + info.createSQLOrderby(flipper)
|
||||
: (" WHERE " + where + (join2 == null ? "" : (" AND " + join2)))) + info.createSQLOrderby(flipper)
|
||||
+ ((flipper == null || flipper.getLimit() < 1) ? "" : (" LIMIT " + flipper.getLimit()));
|
||||
if (debug.get() && info.isLoggable(Level.FINEST)) logger.finest(info.getType().getSimpleName() + " delete sql=" + sql);
|
||||
conn.setReadOnly(false);
|
||||
@@ -704,7 +705,7 @@ public class DataJdbcSource extends AbstractService implements DataSource, DataC
|
||||
String sql = "UPDATE " + info.getTable(node) + " a " + (join1 == null ? "" : (", " + join1))
|
||||
+ " SET " + info.getSQLColumn("a", column) + " = ?"
|
||||
+ ((where == null || where.length() == 0) ? (join2 == null ? "" : (" WHERE " + join2))
|
||||
: (" WHERE " + where + (join2 == null ? "" : (" AND " + join2))));
|
||||
: (" WHERE " + where + (join2 == null ? "" : (" AND " + join2))));
|
||||
if (debug.get() && info.isLoggable(Level.FINEST)) logger.finest(info.getType().getSimpleName() + " update sql=" + sql);
|
||||
conn.setReadOnly(false);
|
||||
Blob blob = conn.createBlob();
|
||||
@@ -717,7 +718,7 @@ public class DataJdbcSource extends AbstractService implements DataSource, DataC
|
||||
String sql = "UPDATE " + info.getTable(node) + " a " + (join1 == null ? "" : (", " + join1))
|
||||
+ " SET " + info.getSQLColumn("a", column) + " = " + info.formatToString(value)
|
||||
+ ((where == null || where.length() == 0) ? (join2 == null ? "" : (" WHERE " + join2))
|
||||
: (" WHERE " + where + (join2 == null ? "" : (" AND " + join2))));
|
||||
: (" WHERE " + where + (join2 == null ? "" : (" AND " + join2))));
|
||||
if (debug.get() && info.isLoggable(Level.FINEST)) logger.finest(info.getType().getSimpleName() + " update sql=" + sql);
|
||||
conn.setReadOnly(false);
|
||||
final Statement stmt = conn.createStatement();
|
||||
@@ -922,7 +923,7 @@ public class DataJdbcSource extends AbstractService implements DataSource, DataC
|
||||
}
|
||||
String sql = "UPDATE " + info.getTable(node) + " a " + (join1 == null ? "" : (", " + join1)) + " SET " + setsql
|
||||
+ ((where == null || where.length() == 0) ? (join2 == null ? "" : (" WHERE " + join2))
|
||||
: (" WHERE " + where + (join2 == null ? "" : (" AND " + join2))));
|
||||
: (" WHERE " + where + (join2 == null ? "" : (" AND " + join2))));
|
||||
//注:LIMIT 仅支持MySQL 且在多表关联式会异常, 该BUG尚未解决
|
||||
sql += info.createSQLOrderby(flipper) + ((flipper == null || flipper.getLimit() < 1) ? "" : (" LIMIT " + flipper.getLimit()));
|
||||
if (debug.get() && info.isLoggable(Level.FINEST)) logger.finest(info.getType().getSimpleName() + " update sql=" + sql);
|
||||
@@ -1108,7 +1109,7 @@ public class DataJdbcSource extends AbstractService implements DataSource, DataC
|
||||
}
|
||||
String sql = "UPDATE " + info.getTable(node) + " a " + (join1 == null ? "" : (", " + join1)) + " SET " + setsql
|
||||
+ ((where == null || where.length() == 0) ? (join2 == null ? "" : (" WHERE " + join2))
|
||||
: (" WHERE " + where + (join2 == null ? "" : (" AND " + join2))));
|
||||
: (" WHERE " + where + (join2 == null ? "" : (" AND " + join2))));
|
||||
if (debug.get() && info.isLoggable(Level.FINEST)) logger.finest(info.getType().getSimpleName() + " update sql=" + sql);
|
||||
conn.setReadOnly(false);
|
||||
if (blobs != null) {
|
||||
@@ -1893,6 +1894,154 @@ public class DataJdbcSource extends AbstractService implements DataSource, DataC
|
||||
return rs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合过滤条件记录的Map集合, 主键值为key <br>
|
||||
* 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit} <br>
|
||||
*
|
||||
* @param <K> 主键泛型
|
||||
* @param <T> Entity泛型
|
||||
* @param clazz Entity类
|
||||
* @param keyStream 主键Stream
|
||||
*
|
||||
* @return Entity的集合
|
||||
*/
|
||||
@Override
|
||||
public <K extends Serializable, T> Map<K, T> queryMap(final Class<T> clazz, final Stream<K> keyStream) {
|
||||
return queryMap(clazz, null, keyStream);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <K extends Serializable, T> CompletableFuture<Map<K, T>> queryMapAsync(final Class<T> clazz, final Stream<K> keyStream) {
|
||||
return CompletableFuture.supplyAsync(() -> queryMap(clazz, null, keyStream), getExecutor());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合过滤条件记录的Map集合, 主键值为key <br>
|
||||
* 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit} <br>
|
||||
*
|
||||
* @param <K> 主键泛型
|
||||
* @param <T> Entity泛型
|
||||
* @param clazz Entity类
|
||||
* @param bean FilterBean
|
||||
*
|
||||
* @return Entity的集合
|
||||
*/
|
||||
@Override
|
||||
public <K extends Serializable, T> Map<K, T> queryMap(final Class<T> clazz, final FilterBean bean) {
|
||||
return queryMap(clazz, null, bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <K extends Serializable, T> CompletableFuture<Map<K, T>> queryMapAsync(final Class<T> clazz, final FilterBean bean) {
|
||||
return CompletableFuture.supplyAsync(() -> queryMap(clazz, null, bean), getExecutor());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合过滤条件记录的Map集合, 主键值为key <br>
|
||||
* 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit} <br>
|
||||
*
|
||||
* @param <K> 主键泛型
|
||||
* @param <T> Entity泛型
|
||||
* @param clazz Entity类
|
||||
* @param node FilterNode
|
||||
*
|
||||
* @return Entity的集合
|
||||
*/
|
||||
@Override
|
||||
public <K extends Serializable, T> Map<K, T> queryMap(final Class<T> clazz, final FilterNode node) {
|
||||
return queryMap(clazz, null, node);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <K extends Serializable, T> CompletableFuture<Map<K, T>> queryMapAsync(final Class<T> clazz, final FilterNode node) {
|
||||
return CompletableFuture.supplyAsync(() -> queryMap(clazz, null, node), getExecutor());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合过滤条件记录的Map集合, 主键值为key <br>
|
||||
* 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit} <br>
|
||||
*
|
||||
* @param <K> 主键泛型
|
||||
* @param <T> Entity泛型
|
||||
* @param clazz Entity类
|
||||
* @param selects 指定字段
|
||||
* @param keyStream 主键Stream
|
||||
*
|
||||
* @return Entity的集合
|
||||
*/
|
||||
@Override
|
||||
public <K extends Serializable, T> Map<K, T> queryMap(final Class<T> clazz, final SelectColumn selects, final Stream<K> keyStream) {
|
||||
if (keyStream == null) return new LinkedHashMap<>();
|
||||
final EntityInfo<T> info = loadEntityInfo(clazz);
|
||||
final ArrayList<K> ids = new ArrayList<>();
|
||||
keyStream.forEach(k -> ids.add(k));
|
||||
final Attribute<T, Serializable> primary = info.primary;
|
||||
List<T> rs = queryList(clazz, FilterNode.create(primary.field(), ids));
|
||||
Map<K, T> map = new LinkedHashMap<>();
|
||||
if (rs.isEmpty()) return new LinkedHashMap<>();
|
||||
for (T item : rs) {
|
||||
map.put((K) primary.get(item), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <K extends Serializable, T> CompletableFuture<Map<K, T>> queryMapAsync(final Class<T> clazz, final SelectColumn selects, final Stream<K> keyStream) {
|
||||
return CompletableFuture.supplyAsync(() -> queryMap(clazz, selects, keyStream), getExecutor());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合过滤条件记录的Map集合, 主键值为key <br>
|
||||
* 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit} <br>
|
||||
*
|
||||
* @param <K> 主键泛型
|
||||
* @param <T> Entity泛型
|
||||
* @param clazz Entity类
|
||||
* @param selects 指定字段
|
||||
* @param bean FilterBean
|
||||
*
|
||||
* @return Entity的集合
|
||||
*/
|
||||
@Override
|
||||
public <K extends Serializable, T> Map<K, T> queryMap(final Class<T> clazz, final SelectColumn selects, final FilterBean bean) {
|
||||
return queryMap(clazz, selects, FilterNodeBean.createFilterNode(bean));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <K extends Serializable, T> CompletableFuture<Map<K, T>> queryMapAsync(final Class<T> clazz, final SelectColumn selects, final FilterBean bean) {
|
||||
return CompletableFuture.supplyAsync(() -> queryMap(clazz, selects, FilterNodeBean.createFilterNode(bean)), getExecutor());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合过滤条件记录的Map集合, 主键值为key <br>
|
||||
* 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit} <br>
|
||||
*
|
||||
* @param <K> 主键泛型
|
||||
* @param <T> Entity泛型
|
||||
* @param clazz Entity类
|
||||
* @param selects 指定字段
|
||||
* @param node FilterNode
|
||||
*
|
||||
* @return Entity的集合
|
||||
*/
|
||||
@Override
|
||||
public <K extends Serializable, T> Map<K, T> queryMap(final Class<T> clazz, final SelectColumn selects, final FilterNode node) {
|
||||
final EntityInfo<T> info = loadEntityInfo(clazz);
|
||||
final Attribute<T, Serializable> primary = info.primary;
|
||||
List<T> rs = queryList(clazz, selects, node);
|
||||
Map<K, T> map = new LinkedHashMap<>();
|
||||
if (rs.isEmpty()) return new LinkedHashMap<>();
|
||||
for (T item : rs) {
|
||||
map.put((K) primary.get(item), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <K extends Serializable, T> CompletableFuture<Map<K, T>> queryMapAsync(final Class<T> clazz, final SelectColumn selects, final FilterNode node) {
|
||||
return CompletableFuture.supplyAsync(() -> queryMap(clazz, selects, node), getExecutor());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据指定字段值查询对象集合
|
||||
*
|
||||
|
||||
@@ -8,6 +8,7 @@ package org.redkale.source;
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.stream.Stream;
|
||||
import org.redkale.util.*;
|
||||
|
||||
/**
|
||||
@@ -1492,6 +1493,168 @@ public interface DataSource {
|
||||
*/
|
||||
public <T, V extends Serializable> CompletableFuture<Sheet<V>> queryColumnSheetAsync(final String selectedColumn, final Class<T> clazz, final Flipper flipper, final FilterNode node);
|
||||
|
||||
/**
|
||||
* 查询符合过滤条件记录的Map集合, 主键值为key <br>
|
||||
* 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit} <br>
|
||||
*
|
||||
* @param <K> 主键泛型
|
||||
* @param <T> Entity泛型
|
||||
* @param clazz Entity类
|
||||
* @param keyStream 主键Stream
|
||||
*
|
||||
* @return Entity的集合
|
||||
*/
|
||||
public <K extends Serializable, T> Map<K, T> queryMap(final Class<T> clazz, final Stream<K> keyStream);
|
||||
|
||||
/**
|
||||
* 查询符合过滤条件记录的List集合 <br>
|
||||
* 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit} <br>
|
||||
*
|
||||
* @param <K> 主键泛型
|
||||
* @param <T> Entity泛型
|
||||
* @param clazz Entity类
|
||||
* @param keyStream 主键Stream
|
||||
*
|
||||
* @return Entity的集合CompletableFuture
|
||||
*/
|
||||
public <K extends Serializable, T> CompletableFuture<Map<K, T>> queryMapAsync(final Class<T> clazz, final Stream<K> keyStream);
|
||||
|
||||
/**
|
||||
* 查询符合过滤条件记录的Map集合, 主键值为key <br>
|
||||
* 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit} <br>
|
||||
*
|
||||
* @param <K> 主键泛型
|
||||
* @param <T> Entity泛型
|
||||
* @param clazz Entity类
|
||||
* @param bean FilterBean
|
||||
*
|
||||
* @return Entity的集合
|
||||
*/
|
||||
public <K extends Serializable, T> Map<K, T> queryMap(final Class<T> clazz, final FilterBean bean);
|
||||
|
||||
/**
|
||||
* 查询符合过滤条件记录的List集合 <br>
|
||||
* 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit} <br>
|
||||
*
|
||||
* @param <K> 主键泛型
|
||||
* @param <T> Entity泛型
|
||||
* @param clazz Entity类
|
||||
* @param bean FilterBean
|
||||
*
|
||||
* @return Entity的集合CompletableFuture
|
||||
*/
|
||||
public <K extends Serializable, T> CompletableFuture<Map<K, T>> queryMapAsync(final Class<T> clazz, final FilterBean bean);
|
||||
|
||||
/**
|
||||
* 查询符合过滤条件记录的Map集合, 主键值为key <br>
|
||||
* 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit} <br>
|
||||
*
|
||||
* @param <K> 主键泛型
|
||||
* @param <T> Entity泛型
|
||||
* @param clazz Entity类
|
||||
* @param node FilterNode
|
||||
*
|
||||
* @return Entity的集合
|
||||
*/
|
||||
public <K extends Serializable, T> Map<K, T> queryMap(final Class<T> clazz, final FilterNode node);
|
||||
|
||||
/**
|
||||
* 查询符合过滤条件记录的List集合 <br>
|
||||
* 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit} <br>
|
||||
*
|
||||
* @param <K> 主键泛型
|
||||
* @param <T> Entity泛型
|
||||
* @param clazz Entity类
|
||||
* @param node FilterNode
|
||||
*
|
||||
* @return Entity的集合CompletableFuture
|
||||
*/
|
||||
public <K extends Serializable, T> CompletableFuture<Map<K, T>> queryMapAsync(final Class<T> clazz, final FilterNode node);
|
||||
|
||||
/**
|
||||
* 查询符合过滤条件记录的Map集合, 主键值为key <br>
|
||||
* 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit} <br>
|
||||
*
|
||||
* @param <K> 主键泛型
|
||||
* @param <T> Entity泛型
|
||||
* @param clazz Entity类
|
||||
* @param selects 指定字段
|
||||
* @param keyStream 主键Stream
|
||||
*
|
||||
* @return Entity的集合
|
||||
*/
|
||||
public <K extends Serializable, T> Map<K, T> queryMap(final Class<T> clazz, final SelectColumn selects, final Stream<K> keyStream);
|
||||
|
||||
/**
|
||||
* 查询符合过滤条件记录的List集合 <br>
|
||||
* 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit} <br>
|
||||
*
|
||||
* @param <K> 主键泛型
|
||||
* @param <T> Entity泛型
|
||||
* @param clazz Entity类
|
||||
* @param selects 指定字段
|
||||
* @param keyStream 主键Stream
|
||||
*
|
||||
* @return Entity的集合CompletableFuture
|
||||
*/
|
||||
public <K extends Serializable, T> CompletableFuture<Map<K, T>> queryMapAsync(final Class<T> clazz, final SelectColumn selects, final Stream<K> keyStream);
|
||||
|
||||
/**
|
||||
* 查询符合过滤条件记录的Map集合, 主键值为key <br>
|
||||
* 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit} <br>
|
||||
*
|
||||
* @param <K> 主键泛型
|
||||
* @param <T> Entity泛型
|
||||
* @param clazz Entity类
|
||||
* @param selects 指定字段
|
||||
* @param bean FilterBean
|
||||
*
|
||||
* @return Entity的集合
|
||||
*/
|
||||
public <K extends Serializable, T> Map<K, T> queryMap(final Class<T> clazz, final SelectColumn selects, final FilterBean bean);
|
||||
|
||||
/**
|
||||
* 查询符合过滤条件记录的List集合 <br>
|
||||
* 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit} <br>
|
||||
*
|
||||
* @param <K> 主键泛型
|
||||
* @param <T> Entity泛型
|
||||
* @param clazz Entity类
|
||||
* @param selects 指定字段
|
||||
* @param bean FilterBean
|
||||
*
|
||||
* @return Entity的集合CompletableFuture
|
||||
*/
|
||||
public <K extends Serializable, T> CompletableFuture<Map<K, T>> queryMapAsync(final Class<T> clazz, final SelectColumn selects, FilterBean bean);
|
||||
|
||||
/**
|
||||
* 查询符合过滤条件记录的Map集合, 主键值为key <br>
|
||||
* 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit} <br>
|
||||
*
|
||||
* @param <K> 主键泛型
|
||||
* @param <T> Entity泛型
|
||||
* @param clazz Entity类
|
||||
* @param selects 指定字段
|
||||
* @param node FilterNode
|
||||
*
|
||||
* @return Entity的集合
|
||||
*/
|
||||
public <K extends Serializable, T> Map<K, T> queryMap(final Class<T> clazz, final SelectColumn selects, final FilterNode node);
|
||||
|
||||
/**
|
||||
* 查询符合过滤条件记录的List集合 <br>
|
||||
* 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit} <br>
|
||||
*
|
||||
* @param <K> 主键泛型
|
||||
* @param <T> Entity泛型
|
||||
* @param clazz Entity类
|
||||
* @param selects 指定字段
|
||||
* @param node FilterNode
|
||||
*
|
||||
* @return Entity的集合CompletableFuture
|
||||
*/
|
||||
public <K extends Serializable, T> CompletableFuture<Map<K, T>> queryMapAsync(final Class<T> clazz, final SelectColumn selects, final FilterNode node);
|
||||
|
||||
/**
|
||||
* 查询符合过滤条件记录的List集合 <br>
|
||||
* 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit} <br>
|
||||
|
||||
@@ -55,9 +55,11 @@ public class FilterNode { //FilterNode 不能实现Serializable接口, 否则
|
||||
}
|
||||
if (subval instanceof Range) {
|
||||
exp = FilterExpress.BETWEEN;
|
||||
} else if (subval instanceof Collection) {
|
||||
exp = FilterExpress.IN;
|
||||
} else if (subval != null && val.getClass().isArray()) {
|
||||
// } else if (subval instanceof Collection) {
|
||||
// exp = FilterExpress.IN;
|
||||
// } else if (subval != null && val.getClass().isArray()) {
|
||||
// exp = FilterExpress.IN;
|
||||
} else {
|
||||
exp = FilterExpress.IN;
|
||||
}
|
||||
} else { //空集合
|
||||
@@ -280,7 +282,7 @@ public class FilterNode { //FilterNode 不能实现Serializable接口, 否则
|
||||
}
|
||||
|
||||
private static boolean needSplit(final FilterExpress express, final Object val0) {
|
||||
if(val0 == null) return false;
|
||||
if (val0 == null) return false;
|
||||
boolean items = express != IN && express != NOTIN; //是否数组集合的表达式
|
||||
if (!items) {
|
||||
if (val0.getClass().isArray()) {
|
||||
|
||||
@@ -17,7 +17,7 @@ public final class Redkale {
|
||||
}
|
||||
|
||||
public static String getDotedVersion() {
|
||||
return "1.8.4";
|
||||
return "1.8.5";
|
||||
}
|
||||
|
||||
public static int getMajorVersion() {
|
||||
|
||||
Reference in New Issue
Block a user