This commit is contained in:
Redkale
2020-01-11 22:02:42 +08:00
parent da2befcb97
commit df1aa2b379
3 changed files with 3 additions and 3 deletions

View File

@@ -601,7 +601,7 @@ public class DataJdbcSource extends DataSqlSource<Connection> {
ps.close();
return CompletableFuture.completedFuture(new Sheet<>(total, list));
} catch (SQLException e) {
if (info.getTableStrategy() != null && info.isTableNotExist(e)) return CompletableFuture.completedFuture(new Sheet<>());
if (info.getTableStrategy() != null && info.isTableNotExist(e)) return CompletableFuture.completedFuture(new Sheet<>(0, new ArrayList()));
CompletableFuture future = new CompletableFuture();
future.completeExceptionally(e);
return future;//return CompletableFuture.failedFuture(e);

View File

@@ -150,7 +150,7 @@ public class DataMemorySource extends DataSqlSource<Void> {
@Override
protected <T> CompletableFuture<Sheet<T>> querySheetDB(EntityInfo<T> info, final boolean readcache, boolean needtotal, final boolean distinct, SelectColumn selects, Flipper flipper, FilterNode node) {
return CompletableFuture.completedFuture(new Sheet<>());
return CompletableFuture.completedFuture(new Sheet<>(0, new ArrayList()));
}
}

View File

@@ -436,7 +436,7 @@ public final class EntityCache<T> {
if (distinct) stream = distinctStream(stream, keyattrs);
total = stream.count();
}
if (needtotal && total == 0) return new Sheet<>();
if (needtotal && total == 0) return new Sheet<>(0, new ArrayList());
Stream<T> stream = this.list.stream();
if (filter != null) stream = stream.filter(filter);
if (distinct) stream = distinctStream(stream, keyattrs);