From 853f501ffd27adc92085f2ba87bdec55ef143bc7 Mon Sep 17 00:00:00 2001 From: redkale Date: Tue, 9 Jan 2024 13:31:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E4=B9=89DataSqlMapper?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../redkale/persistence/SourceResource.java | 33 + .../org/redkale/source/DataSqlMapper.java | 3407 +++++++++++++++++ .../source/spi/DataSqlMapperBuilder.java | 21 + .../source/spi/SourceModuleEngine.java | 2 + 4 files changed, 3463 insertions(+) create mode 100644 src/main/java/org/redkale/persistence/SourceResource.java create mode 100644 src/main/java/org/redkale/source/DataSqlMapper.java create mode 100644 src/main/java/org/redkale/source/spi/DataSqlMapperBuilder.java diff --git a/src/main/java/org/redkale/persistence/SourceResource.java b/src/main/java/org/redkale/persistence/SourceResource.java new file mode 100644 index 000000000..b45543929 --- /dev/null +++ b/src/main/java/org/redkale/persistence/SourceResource.java @@ -0,0 +1,33 @@ +/* + * + */ +package org.redkale.persistence; + +import java.lang.annotation.Documented; +import static java.lang.annotation.ElementType.TYPE; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import static java.lang.annotation.RetentionPolicy.RUNTIME; +import java.lang.annotation.Target; + +/** + * 指定Source的资源名 + * + *

+ * 详情见: https://redkale.org + * + * + * @see org.redkale.source.DataSqlMapper + * + * @author zhangjx + * + * @since 2.8.0 + */ +@Inherited +@Documented +@Target({TYPE}) +@Retention(RUNTIME) +public @interface SourceResource { + + String value(); +} diff --git a/src/main/java/org/redkale/source/DataSqlMapper.java b/src/main/java/org/redkale/source/DataSqlMapper.java new file mode 100644 index 000000000..43bdc4a9f --- /dev/null +++ b/src/main/java/org/redkale/source/DataSqlMapper.java @@ -0,0 +1,3407 @@ +/* + * + */ +package org.redkale.source; + +import java.io.Serializable; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.CompletableFuture; +import java.util.stream.Stream; +import org.redkale.util.LambdaFunction; +import org.redkale.util.LambdaSupplier; +import org.redkale.util.SelectColumn; +import org.redkale.util.Sheet; + +/** + * 类似Mybatis的Mapper接口类, 接口系列和DataSource相似度高
+ * 子类需要注解数据源{@link org.redkale.persistence.SourceResource},没有指定会找资源名为空的默认DataSqlSource + * + *

+ * 详情见: https://redkale.org + * + * @see org.redkale.persistence.SourceResource + * + * @author zhangjx + * @param T + * + * @since 2.8.0 + */ +public interface DataSqlMapper { + + /** + * 获取当前数据源 + * + * @return DataSqlSource + */ + DataSqlSource dataSource(); + + /** + * 获取当前实体类型 + * + * + * @return Class + */ + Class entityType(); + + /** + * 新增记录
+ * + * @param entitys Entity对象 + * + * @return CompletableFuture + */ + default int insert(T... entitys) { + return dataSource().insert(entitys); + } + + /** + * 新增记录
+ * + * @param entitys Entity对象 + * + * @return CompletableFuture + */ + default int insert(Collection entitys) { + return dataSource().insert(entitys); + } + + /** + * 新增记录
+ * + * @param entitys Entity对象 + * + * @return CompletableFuture + */ + default int insert(Stream entitys) { + return dataSource().insert(entitys); + } + + /** + * 新增记录
+ * + * @param entitys Entity对象 + * + * @return CompletableFuture + */ + default CompletableFuture insertAsync(T... entitys) { + return dataSource().insertAsync(entitys); + } + + /** + * 新增记录
+ * + * @param entitys Entity对象 + * + * @return CompletableFuture + */ + default CompletableFuture insertAsync(Collection entitys) { + return dataSource().insertAsync(entitys); + } + + /** + * 新增记录
+ * + * @param entitys Entity对象 + * + * @return CompletableFuture + */ + default CompletableFuture insertAsync(Stream entitys) { + return dataSource().insertAsync(entitys); + } + + /** + * 删除指定主键值的记录
+ * 等价SQL: DELETE FROM {table} WHERE {primary} IN {values.id}
+ * + * @param entitys Entity对象 + * + * @return 影响的记录条数CompletableFuture + */ + default int delete(T... entitys) { + return dataSource().delete(entitys); + } + + /** + * 删除指定主键值的记录
+ * 等价SQL: DELETE FROM {table} WHERE {primary} IN {values.id}
+ * + * @param entitys Entity对象 + * + * @return 影响的记录条数CompletableFuture + */ + default int delete(Collection entitys) { + return dataSource().delete(entitys); + } + + /** + * 删除指定主键值的记录
+ * 等价SQL: DELETE FROM {table} WHERE {primary} IN {values.id}
+ * + * @param entitys Entity对象 + * + * @return 影响的记录条数CompletableFuture + */ + default int delete(Stream entitys) { + return dataSource().delete(entitys); + } + + /** + * 删除指定主键值的记录
+ * 等价SQL: DELETE FROM {table} WHERE {primary} IN {values.id}
+ * + * @param entitys Entity对象 + * + * @return 影响的记录条数CompletableFuture + */ + default CompletableFuture deleteAsync(T... entitys) { + return dataSource().deleteAsync(entitys); + } + + /** + * 删除指定主键值的记录
+ * 等价SQL: DELETE FROM {table} WHERE {primary} IN {values.id}
+ * + * @param entitys Entity对象 + * + * @return 影响的记录条数CompletableFuture + */ + default CompletableFuture deleteAsync(Collection entitys) { + return dataSource().deleteAsync(entitys); + } + + /** + * 删除指定主键值的记录
+ * 等价SQL: DELETE FROM {table} WHERE {primary} IN {values.id}
+ * + * @param entitys Entity对象 + * + * @return 影响的记录条数CompletableFuture + */ + default CompletableFuture deleteAsync(Stream entitys) { + return dataSource().deleteAsync(entitys); + } + + /** + * 删除指定主键值的记录,多主键值必须在同一张表中
+ * 等价SQL: DELETE FROM {table} WHERE {primary} IN {ids}
+ * + * @param pks 主键值 + * + * @return 影响的记录条数 + */ + default int deleteById(Serializable... pks) { + return dataSource().delete(entityType(), pks); + } + + /** + * 删除指定主键值的记录,多主键值必须在同一张表中
+ * 等价SQL: DELETE FROM {table} WHERE {primary} IN {ids}
+ * + * @param pks 主键值 + * + * @return 影响的记录条数CompletableFuture + */ + default CompletableFuture deleteByIdAsync(Serializable... pks) { + return dataSource().deleteAsync(entityType(), pks); + } + + //------------------------update--------------------------- + /** + * 更新记录
+ * 等价SQL:
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id1}
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id2}
+ * ···
+ * + * @param entitys Entity对象 + * + * @return 影响的记录条数 + */ + default int update(T... entitys) { + return dataSource().update(entitys); + } + + /** + * 更新记录
+ * 等价SQL:
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id1}
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id2}
+ * ···
+ * + * @param entitys Entity对象 + * + * @return 影响的记录条数 + */ + default int update(Collection entitys) { + return dataSource().update(entitys); + } + + /** + * 更新记录
+ * 等价SQL:
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id1}
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id2}
+ * ···
+ * + * @param entitys Entity对象 + * + * @return 影响的记录条数 + */ + default int update(Stream entitys) { + return dataSource().update(entitys); + } + + /** + * 更新记录
+ * 等价SQL:
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id1}
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id2}
+ * ···
+ * + * @param entitys Entity对象 + * + * @return 影响的记录条数CompletableFuture + */ + default CompletableFuture updateAsync(T... entitys) { + return dataSource().updateAsync(entitys); + } + + /** + * 更新记录
+ * 等价SQL:
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id1}
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id2}
+ * ···
+ * + * @param entitys Entity对象 + * + * @return 影响的记录条数CompletableFuture + */ + default CompletableFuture updateAsync(Collection entitys) { + return dataSource().updateAsync(entitys); + } + + /** + * 更新记录
+ * 等价SQL:
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id1}
+ * UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id2}
+ * ···
+ * + * @param entitys Entity对象 + * + * @return 影响的记录条数CompletableFuture + */ + default CompletableFuture updateAsync(Stream entitys) { + return dataSource().updateAsync(entitys); + } + + /** + * 更新单个记录的单个字段
+ * 注意:即使字段标记为@Column(updatable=false)也会被更新
+ * 等价SQL: UPDATE {table} SET {column} = {value} WHERE {primary} = {id}
+ * + * @param pk 主键 + * @param column 待更新的字段名 + * @param value 更新值 + * + * @return 影响的记录条数 + */ + default int updateColumn(Serializable pk, String column, Serializable value) { + return dataSource().updateColumn(entityType(), pk, column, value); + } + + /** + * 更新单个记录的单个字段
+ * 注意:即使字段标记为@Column(updatable=false)也会被更新
+ * 等价SQL: UPDATE {table} SET {column} = {value} WHERE {primary} = {id}
+ * + * @param 更新值泛型 + * @param pk 主键 + * @param func 更新值Lambda + * + * @return 影响的记录条数 + */ + default int updateColumn(Serializable pk, LambdaSupplier func) { + return dataSource().updateColumn(entityType(), pk, func); + } + + /** + * 更新单个记录的单个字段
+ * 注意:即使字段标记为@Column(updatable=false)也会被更新
+ * 等价SQL: UPDATE {table} SET {column} = {value} WHERE {primary} = {id}
+ * + * @param pk 主键 + * @param column 待更新的字段名 + * @param value 更新值 + * + * @return 影响的记录条数CompletableFuture + */ + default CompletableFuture updateColumnAsync(Serializable pk, String column, Serializable value) { + return dataSource().updateColumnAsync(entityType(), pk, column, value); + } + + /** + * 更新单个记录的单个字段
+ * 注意:即使字段标记为@Column(updatable=false)也会被更新
+ * 等价SQL: UPDATE {table} SET {column} = {value} WHERE {primary} = {id}
+ * + * @param 更新值泛型 + * @param pk 主键 + * @param func 更新值Lambda + * + * @return 影响的记录条数 + */ + default CompletableFuture updateColumnAsync(Serializable pk, LambdaSupplier func) { + return dataSource().updateColumnAsync(entityType(), pk, func); + } + + /** + * 更新符合过滤条件记录的单个字段
+ * 注意:即使字段标记为@Column(updatable=false)也会被更新
+ * 等价SQL: UPDATE {table} SET {column} = {value} WHERE {filter node}
+ * + * @param clazz Entity类 + * @param column 待更新的字段名 + * @param value 更新值 + * @param node 过滤条件 + * + * @return 影响的记录条数 + */ + default int updateColumn(String column, Serializable value, FilterNode node) { + return dataSource().updateColumn(entityType(), column, value, node); + } + + /** + * 更新符合过滤条件记录的单个字段
+ * 注意:即使字段标记为@Column(updatable=false)也会被更新
+ * 等价SQL: UPDATE {table} SET {column} = {value} WHERE {filter node}
+ * + * @param 更新值泛型 + * @param func 更新值Lambda + * @param node 过滤条件 + * + * @return 影响的记录条数 + */ + default int updateColumn(LambdaSupplier func, FilterNode node) { + return dataSource().updateColumn(entityType(), func, node); + } + + /** + * 更新符合过滤条件记录的单个字段
+ * 注意:即使字段标记为@Column(updatable=false)也会被更新
+ * 等价SQL: UPDATE {table} SET {column} = {value} WHERE {filter node}
+ * + * @param column 待更新的字段名 + * @param value 更新值 + * @param node 过滤条件 + * + * @return 影响的记录条数CompletableFuture + */ + default CompletableFuture updateColumnAsync(String column, Serializable value, FilterNode node) { + return dataSource().updateColumnAsync(entityType(), column, value, node); + } + + /** + * 更新符合过滤条件记录的单个字段
+ * 注意:即使字段标记为@Column(updatable=false)也会被更新
+ * 等价SQL: UPDATE {table} SET {column} = {value} WHERE {filter node}
+ * + * @param 更新值泛型 + * @param func 更新值Lambda + * @param node 过滤条件 + * + * @return 影响的记录条数 + */ + default CompletableFuture updateColumnAsync(LambdaSupplier func, FilterNode node) { + return dataSource().updateColumnAsync(entityType(), func, node); + } + + /** + * 更新指定主键值记录的部分字段
+ * 字段赋值操作选项见 ColumnExpress
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} += {value2}, {column3} *= {value3}, ··· WHERE {filter node}
+ * + * @param pk 主键 + * @param values 更新字段 + * + * @return 影响的记录条数 + */ + default int updateColumn(Serializable pk, ColumnValue... values) { + return dataSource().updateColumn(entityType(), pk, values); + } + + /** + * 更新指定主键值记录的部分字段
+ * 字段赋值操作选项见 ColumnExpress
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} += {value2}, {column3} *= {value3}, ··· WHERE {filter node}
+ * + * @param pk 主键 + * @param func 更新字段 + * @param value 更新字段值 + * + * @return 影响的记录条数 + */ + default int updateColumn(Serializable pk, LambdaFunction func, Serializable value) { + return dataSource().updateColumn(entityType(), pk, func, value); + } + + /** + * 更新指定主键值记录的部分字段
+ * 字段赋值操作选项见 ColumnExpress
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} += {value2}, {column3} *= {value3}, ··· WHERE {filter node}
+ * + * @param pk 主键 + * @param values 更新字段 + * + * @return 影响的记录条数CompletableFuture + */ + default CompletableFuture updateColumnAsync(Serializable pk, ColumnValue... values) { + return dataSource().updateColumnAsync(entityType(), pk, values); + } + + /** + * 更新指定主键值记录的部分字段
+ * 字段赋值操作选项见 ColumnExpress
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} += {value2}, {column3} *= {value3}, ··· WHERE {filter node}
+ * + * @param pk 主键 + * @param func 更新字段 + * @param value 更新字段值 + * + * @return 影响的记录条数CompletableFuture + */ + default CompletableFuture updateColumnAsync(Serializable pk, LambdaFunction func, Serializable value) { + return dataSource().updateColumnAsync(entityType(), pk, func, value); + } + + /** + * 更新符合过滤条件记录的部分字段
+ * 字段赋值操作选项见 ColumnExpress
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} += {value2}, {column3} *= {value3}, ··· WHERE {filter node}
+ * + * @param node 过滤条件 + * @param values 更新字段 + * + * @return 影响的记录条数 + */ + default int updateColumn(FilterNode node, ColumnValue... values) { + return dataSource().updateColumn(entityType(), node, values); + } + + /** + * 更新符合过滤条件记录的部分字段
+ * 字段赋值操作选项见 ColumnExpress
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} += {value2}, {column3} *= {value3}, ··· WHERE {filter node}
+ * + * @param node 过滤条件 + * @param values 更新字段 + * + * @return 影响的记录条数CompletableFuture + */ + default CompletableFuture updateColumnAsync(FilterNode node, ColumnValue... values) { + return dataSource().updateColumnAsync(entityType(), node, values); + } + + /** + * 更新符合过滤条件的记录的指定字段
+ * Flipper中offset字段将被忽略
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} += {value2}, {column3} *= {value3}, ··· WHERE {filter node} ORDER BY + * {flipper.sort}
+ * + * + * @param node 过滤条件 + * @param flipper 翻页对象 + * @param values 更新字段 + * + * @return 影响的记录条数 + */ + default int updateColumn(FilterNode node, Flipper flipper, ColumnValue... values) { + return dataSource().updateColumn(entityType(), node, flipper, values); + } + + /** + * 更新符合过滤条件的记录的指定字段
+ * Flipper中offset字段将被忽略
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} += {value2}, {column3} *= {value3}, ··· WHERE {filter node} ORDER BY + * {flipper.sort}
+ * + * @param node 过滤条件 + * @param flipper 翻页对象 + * @param values 更新字段 + * + * @return 影响的记录条数CompletableFuture + */ + default CompletableFuture updateColumnAsync(FilterNode node, Flipper flipper, ColumnValue... values) { + return dataSource().updateColumnAsync(entityType(), node, flipper, values); + } + + /** + * 更新单个记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {primary} = {bean.id}
+ * + * @param entity 待更新的Entity对象 + * @param columns 需更新的字段名 + * + * @return 影响的记录条数 + */ + default int updateColumn(T entity, String... columns) { + return dataSource().updateColumn(entityType(), columns); + } + + /** + * 更新单个记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {primary} = {bean.id}
+ * + * @param entity 待更新的Entity对象 + * @param funcs 需更新的字段名Lambda集合 + * + * @return 影响的记录条数 + */ + default int updateColumn(T entity, LambdaFunction... funcs) { + return dataSource().updateColumn(entityType(), funcs); + } + + /** + * 更新单个记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {primary} = {bean.id}
+ * + * @param entity 待更新的Entity对象 + * @param columns 需更新的字段名 + * + * @return 影响的记录条数CompletableFuture + */ + default CompletableFuture updateColumnAsync(T entity, String... columns) { + return dataSource().updateColumnAsync(entityType(), columns); + } + + /** + * 更新单个记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {primary} = {bean.id}
+ * + * @param entity 待更新的Entity对象 + * @param funcs 需更新的字段名Lambda集合 + * + * @return 影响的记录条数CompletableFuture + */ + default CompletableFuture updateColumnAsync(T entity, LambdaFunction... funcs) { + return dataSource().updateColumnAsync(entityType(), funcs); + } + + /** + * 更新符合过滤条件记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {filter node}
+ * + * @param entity 待更新的Entity对象 + * @param node 过滤条件 + * @param columns 需更新的字段名 + * + * @return 影响的记录条数 + */ + default int updateColumn(T entity, FilterNode node, String... columns) { + return dataSource().updateColumn(entity, node, columns); + } + + /** + * 更新符合过滤条件记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {filter node}
+ * + * @param entity 待更新的Entity对象 + * @param node 过滤条件 + * @param funcs 需更新的字段名Lambda集合 + * + * @return 影响的记录条数 + */ + default int updateColumn(T entity, FilterNode node, LambdaFunction... funcs) { + return dataSource().updateColumn(entity, node, funcs); + } + + /** + * 更新符合过滤条件记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {filter node}
+ * + * @param entity 待更新的Entity对象 + * @param node 过滤条件 + * @param columns 需更新的字段名 + * + * @return 影响的记录条数CompletableFuture + */ + default CompletableFuture updateColumnAsync(T entity, FilterNode node, String... columns) { + return dataSource().updateColumnAsync(entity, node, columns); + } + + /** + * 更新符合过滤条件记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {filter node}
+ * + * @param entity 待更新的Entity对象 + * @param node 过滤条件 + * @param funcs 需更新的字段名Lambda集合 + * + * @return 影响的记录条数 + */ + default CompletableFuture updateColumnAsync(T entity, FilterNode node, LambdaFunction... funcs) { + return dataSource().updateColumnAsync(entity, node, funcs); + } + + /** + * 更新单个记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {primary} = {bean.id}
+ * + * @param entity 待更新的Entity对象 + * @param selects 指定字段 + * + * @return 影响的记录条数 + */ + default int updateColumn(T entity, SelectColumn selects) { + return dataSource().updateColumn(entity, selects); + } + + /** + * 更新单个记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {primary} = {bean.id}
+ * + * @param entity 待更新的Entity对象 + * @param selects 指定字段 + * + * @return 影响的记录条数CompletableFuture + */ + default CompletableFuture updateColumnAsync(T entity, SelectColumn selects) { + return dataSource().updateColumnAsync(entity, selects); + } + + /** + * 更新符合过滤条件记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {filter node}
+ * + * @param entity 待更新的Entity对象 + * @param node 过滤条件 + * @param selects 指定字段 + * + * @return 影响的记录条数 + */ + default int updateColumn(T entity, FilterNode node, SelectColumn selects) { + return dataSource().updateColumn(entity, node, selects); + } + + /** + * 更新符合过滤条件记录的指定字段
+ * 注意:Entity类中标记为@Column(updatable=false)不会被更新
+ * 等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {filter node}
+ * + * @param entity 待更新的Entity对象 + * @param node 过滤条件 + * @param selects 指定字段 + * + * @return 影响的记录条数CompletableFuture + */ + default CompletableFuture updateColumnAsync(T entity, FilterNode node, SelectColumn selects) { + return dataSource().updateColumnAsync(entity, node, selects); + } + + //-----------------------getXXXXResult----------------------------- + default Number getNumberResult(FilterFunc func, String column) { + return dataSource().getNumberResult(entityType(), func, column); + } + + /** + * 获取符合过滤条件记录的聚合结果, 无结果返回null
+ * 等价SQL: SELECT FUNC{column} FROM {table}
+ * 如 getNumberResultAsync(User.class, FilterFunc.COUNT, null) 等价于: SELECT COUNT(*) FROM {table}
+ * + * + * @param func 聚合函数 + * @param column 指定字段 + * + * @return 聚合结果CompletableFuture + */ + default CompletableFuture getNumberResultAsync(FilterFunc func, String column) { + return dataSource().getNumberResultAsync(entityType(), func, column); + } + + /** + * 获取符合过滤条件记录的聚合结果, 无结果返回null
+ * 等价SQL: SELECT FUNC{column} FROM {table} WHERE {filter bean}
+ * 如 getNumberResultAsync(User.class, FilterFunc.COUNT, null, (FilterBean)null) 等价于: SELECT COUNT(*) FROM {table}
+ * + * + * @param func 聚合函数 + * @param column 指定字段 + * @param bean 过滤条件 + * + * @return 聚合结果 + */ + default Number getNumberResult(FilterFunc func, String column, FilterBean bean) { + return dataSource().getNumberResult(entityType(), func, column, bean); + } + + /** + * 获取符合过滤条件记录的聚合结果, 无结果返回null
+ * 等价SQL: SELECT FUNC{column} FROM {table} WHERE {filter bean}
+ * 如 getNumberResultAsync(User.class, FilterFunc.COUNT, null, (FilterBean)null) 等价于: SELECT COUNT(*) FROM {table}
+ * + * + * @param func 聚合函数 + * @param column 指定字段 + * @param bean 过滤条件 + * + * @return 聚合结果CompletableFuture + */ + default CompletableFuture getNumberResultAsync(FilterFunc func, String column, FilterBean bean) { + return dataSource().getNumberResultAsync(entityType(), func, column, bean); + } + + /** + * 获取符合过滤条件记录的聚合结果, 无结果返回null
+ * 等价SQL: SELECT FUNC{column} FROM {table} WHERE {filter node}
+ * 如 getNumberResultAsync(User.class, FilterFunc.MAX, "createtime", (FilterNode)null) 等价于: SELECT MAX(createtime) FROM {table}
+ * + * + * @param func 聚合函数 + * @param column 指定字段 + * @param node 过滤条件 + * + * @return 聚合结果 + */ + default Number getNumberResult(FilterFunc func, String column, FilterNode node) { + return dataSource().getNumberResult(entityType(), func, column, node); + } + + /** + * 获取符合过滤条件记录的聚合结果, 无结果返回null
+ * 等价SQL: SELECT FUNC{column} FROM {table} WHERE {filter node}
+ * 如 getNumberResultAsync(User.class, FilterFunc.MAX, "createtime", (FilterNode)null) 等价于: SELECT MAX(createtime) FROM {table}
+ * + * + * @param func 聚合函数 + * @param column 指定字段 + * @param node 过滤条件 + * + * @return 聚合结果 + */ + default CompletableFuture getNumberResultAsync(FilterFunc func, String column, FilterNode node) { + return dataSource().getNumberResultAsync(entityType(), func, column, node); + } + + /** + * 获取符合过滤条件记录的聚合结果, 无结果返回默认值
+ * 等价SQL: SELECT FUNC{column} FROM {table}
+ * 如 getNumberResultAsync(User.class, FilterFunc.MAX, "createtime") 等价于: SELECT MAX(createtime) FROM {table}
+ * + * + * @param func 聚合函数 + * @param defVal 默认值 + * @param column 指定字段 + * + * @return 聚合结果 + */ + default Number getNumberResult(FilterFunc func, Number defVal, String column) { + return dataSource().getNumberResult(entityType(), func, defVal, column); + } + + /** + * 获取符合过滤条件记录的聚合结果, 无结果返回默认值
+ * 等价SQL: SELECT FUNC{column} FROM {table}
+ * 如 getNumberResultAsync(User.class, FilterFunc.MAX, "createtime") 等价于: SELECT MAX(createtime) FROM {table}
+ * + * + * @param func 聚合函数 + * @param defVal 默认值 + * @param column 指定字段 + * + * @return 聚合结果CompletableFuture + */ + default CompletableFuture getNumberResultAsync(FilterFunc func, Number defVal, String column) { + return dataSource().getNumberResultAsync(entityType(), func, defVal, column); + } + + /** + * 获取符合过滤条件记录的聚合结果, 无结果返回默认值
+ * 等价SQL: SELECT FUNC{column} FROM {table} WHERE {filter bean}
+ * 如 getNumberResultAsync(User.class, FilterFunc.MAX, "createtime", (FilterNode)null) 等价于: SELECT MAX(createtime) FROM {table}
+ * + * + * @param func 聚合函数 + * @param defVal 默认值 + * @param column 指定字段 + * @param bean 过滤条件 + * + * @return 聚合结果 + */ + default Number getNumberResult(FilterFunc func, Number defVal, String column, FilterBean bean) { + return dataSource().getNumberResult(entityType(), func, defVal, column, bean); + } + + /** + * 获取符合过滤条件记录的聚合结果, 无结果返回默认值
+ * 等价SQL: SELECT FUNC{column} FROM {table} WHERE {filter bean}
+ * 如 getNumberResultAsync(User.class, FilterFunc.MAX, "createtime", (FilterNode)null) 等价于: SELECT MAX(createtime) FROM {table}
+ * + * + * @param func 聚合函数 + * @param defVal 默认值 + * @param column 指定字段 + * @param bean 过滤条件 + * + * @return 聚合结果CompletableFuture + */ + default CompletableFuture getNumberResultAsync(FilterFunc func, Number defVal, String column, FilterBean bean) { + return dataSource().getNumberResultAsync(entityType(), func, defVal, column, bean); + } + + /** + * 获取符合过滤条件记录的聚合结果, 无结果返回默认值
+ * 等价SQL: SELECT FUNC{column} FROM {table} WHERE {filter node}
+ * 如 getNumberResultAsync(User.class, FilterFunc.MAX, "createtime", (FilterNode)null) 等价于: SELECT MAX(createtime) FROM {table}
+ * + * + * @param func 聚合函数 + * @param defVal 默认值 + * @param column 指定字段 + * @param node 过滤条件 + * + * @return 聚合结果 + */ + default Number getNumberResult(FilterFunc func, Number defVal, String column, FilterNode node) { + return dataSource().getNumberResult(entityType(), func, defVal, column, node); + } + + /** + * 获取符合过滤条件记录的聚合结果, 无结果返回默认值
+ * 等价SQL: SELECT FUNC{column} FROM {table} WHERE {filter node}
+ * 如 getNumberResultAsync(User.class, FilterFunc.MAX, "createtime", (FilterNode)null) 等价于: SELECT MAX(createtime) FROM {table}
+ * + * + * @param func 聚合函数 + * @param defVal 默认值 + * @param column 指定字段 + * @param node 过滤条件 + * + * @return 聚合结果CompletableFuture + */ + default CompletableFuture getNumberResultAsync(FilterFunc func, Number defVal, String column, FilterNode node) { + return dataSource().getNumberResultAsync(entityType(), func, defVal, column, node); + } + + /** + * 获取符合过滤条件记录的聚合结果Map
+ * 等价SQL: SELECT FUNC1{column1}, FUNC2{column2}, ··· FROM {table}
+ * 如 getNumberMapAsync(User.class, new FilterFuncColumn(FilterFunc.MAX, "createtime")) 等价于: SELECT MAX(createtime) FROM {table}
+ * + * @param Number + * + * @param columns 聚合字段 + * + * @return 聚合结果Map + */ + default Map getNumberMap(FilterFuncColumn... columns) { + return dataSource().getNumberMap(entityType(), columns); + } + + /** + * 获取符合过滤条件记录的聚合结果Map
+ * 等价SQL: SELECT FUNC1{column1}, FUNC2{column2}, ··· FROM {table}
+ * 如 getNumberMapAsync(User.class, new FilterFuncColumn(FilterFunc.MAX, "createtime")) 等价于: SELECT MAX(createtime) FROM {table}
+ * + * @param Number + * + * @param columns 聚合字段 + * + * @return 聚合结果Map CompletableFuture + */ + default CompletableFuture> getNumberMapAsync(FilterFuncColumn... columns) { + return dataSource().getNumberMapAsync(entityType(), columns); + } + + /** + * 获取符合过滤条件记录的聚合结果Map
+ * 等价SQL: SELECT FUNC1{column1}, FUNC2{column2}, ··· FROM {table} WHERE {filter bean}
+ * 如 getNumberMapAsync(User.class, (FilterBean)null, new FilterFuncColumn(FilterFunc.MAX, "createtime")) 等价于: SELECT MAX(createtime) FROM {table} + *
+ * + * @param Number + * + * @param bean 过滤条件 + * @param columns 聚合字段 + * + * @return 聚合结果Map + */ + default Map getNumberMap(FilterBean bean, FilterFuncColumn... columns) { + return dataSource().getNumberMap(entityType(), bean, columns); + } + + /** + * 获取符合过滤条件记录的聚合结果Map
+ * 等价SQL: SELECT FUNC1{column1}, FUNC2{column2}, ··· FROM {table} WHERE {filter bean}
+ * 如 getNumberMapAsync(User.class, (FilterBean)null, new FilterFuncColumn(FilterFunc.MAX, "createtime")) 等价于: SELECT MAX(createtime) FROM {table} + *
+ * + * @param Number + * + * @param bean 过滤条件 + * @param columns 聚合字段 + * + * @return 聚合结果Map CompletableFuture + */ + default CompletableFuture> getNumberMapAsync(FilterBean bean, FilterFuncColumn... columns) { + return dataSource().getNumberMapAsync(entityType(), bean, columns); + } + + /** + * 获取符合过滤条件记录的聚合结果Map
+ * 等价SQL: SELECT FUNC1{column1}, FUNC2{column2}, ··· FROM {table} WHERE {filter node}
+ * 如 getNumberMapAsync(User.class, (FilterNode)null, new FilterFuncColumn(FilterFunc.MAX, "createtime")) 等价于: SELECT MAX(createtime) FROM {table} + *
+ * + * @param Number + * + * @param node 过滤条件 + * @param columns 聚合字段 + * + * @return 聚合结果Map + */ + default Map getNumberMap(FilterNode node, FilterFuncColumn... columns) { + return dataSource().getNumberMap(entityType(), node, columns); + } + + /** + * 获取符合过滤条件记录的聚合结果Map
+ * 等价SQL: SELECT FUNC1{column1}, FUNC2{column2}, ··· FROM {table} WHERE {filter node}
+ * 如 getNumberMapAsync(User.class, (FilterNode)null, new FilterFuncColumn(FilterFunc.MAX, "createtime")) 等价于: SELECT MAX(createtime) FROM {table} + *
+ * + * @param Number + * + * @param node 过滤条件 + * @param columns 聚合字段 + * + * @return 聚合结果Map + */ + default CompletableFuture> getNumberMapAsync(FilterNode node, FilterFuncColumn... columns) { + return dataSource().getNumberMapAsync(entityType(), node, columns); + } + + /** + * 查询符合过滤条件记录的GROUP BY聚合结果Map
+ * 等价SQL: SELECT keyColumn, FUNC{funcColumn} FROM {table} GROUP BY {keyColumn}
+ * 如 queryColumnMapAsync(User.class, "name", FilterFunc.MAX, "createtime") 等价于: SELECT name, MAX(createtime) FROM user GROUP BY name
+ * + * + * @param Key字段的数据类型 + * @param Number + * + * @param keyColumn Key字段 + * @param func 聚合函数 + * @param funcColumn 聚合字段 + * + * @return 聚合结果Map + */ + default Map queryColumnMap(String keyColumn, FilterFunc func, String funcColumn) { + return dataSource().queryColumnMap(entityType(), keyColumn, func, funcColumn); + } + + /** + * 查询符合过滤条件记录的GROUP BY聚合结果Map
+ * 等价SQL: SELECT keyColumn, FUNC{funcColumn} FROM {table} GROUP BY {keyColumn}
+ * 如 queryColumnMapAsync(User.class, "name", FilterFunc.MAX, "createtime") 等价于: SELECT name, MAX(createtime) FROM user GROUP BY name
+ * + * + * @param Key字段的数据类型 + * @param Number + * + * @param keyColumn Key字段 + * @param func 聚合函数 + * @param funcColumn 聚合字段 + * + * @return 聚合结果Map CompletableFuture + */ + default < K extends Serializable, N extends Number> CompletableFuture> queryColumnMapAsync(String keyColumn, FilterFunc func, String funcColumn) { + return dataSource().queryColumnMapAsync(entityType(), keyColumn, func, funcColumn); + } + + /** + * 查询符合过滤条件记录的GROUP BY聚合结果Map
+ * 等价SQL: SELECT keyColumn, FUNC{funcColumn} FROM {table} WHERE {filter bean} GROUP BY {keyColumn}
+ * 如 queryColumnMapAsync(User.class, "name", FilterFunc.MAX, "createtime", (FilterBean)null) 等价于: SELECT name, MAX(createtime) FROM user GROUP BY + * name
+ * + * + * @param Key字段的数据类型 + * @param Number + * + * @param keyColumn Key字段 + * @param func 聚合函数 + * @param funcColumn 聚合字段 + * @param bean 过滤条件 + * + * @return 聚合结果Map + */ + default Map queryColumnMap(String keyColumn, FilterFunc func, String funcColumn, FilterBean bean) { + return dataSource().queryColumnMap(entityType(), keyColumn, func, funcColumn, bean); + } + + /** + * 查询符合过滤条件记录的GROUP BY聚合结果Map
+ * 等价SQL: SELECT keyColumn, FUNC{funcColumn} FROM {table} WHERE {filter bean} GROUP BY {keyColumn}
+ * 如 queryColumnMapAsync(User.class, "name", FilterFunc.MAX, "createtime", (FilterBean)null) 等价于: SELECT name, MAX(createtime) FROM user GROUP BY + * name
+ * + * + * @param Key字段的数据类型 + * @param Number + * + * @param keyColumn Key字段 + * @param func 聚合函数 + * @param funcColumn 聚合字段 + * @param bean 过滤条件 + * + * @return 聚合结果Map CompletableFuture + */ + default CompletableFuture> queryColumnMapAsync(String keyColumn, FilterFunc func, String funcColumn, FilterBean bean) { + return dataSource().queryColumnMapAsync(entityType(), keyColumn, func, funcColumn, bean); + } + + /** + * 查询符合过滤条件记录的GROUP BY聚合结果Map
+ * 等价SQL: SELECT keyColumn, FUNC{funcColumn} FROM {table} WHERE {filter node} GROUP BY {keyColumn}
+ * 如 queryColumnMapAsync(User.class, "name", FilterFunc.MAX, "createtime", (FilterNode)null) 等价于: SELECT name, MAX(createtime) FROM user GROUP BY + * name
+ * + * + * @param Key字段的数据类型 + * @param Number + * + * @param keyColumn Key字段 + * @param func 聚合函数 + * @param funcColumn 聚合字段 + * @param node 过滤条件 + * + * @return 聚合结果Map + */ + default Map queryColumnMap(String keyColumn, FilterFunc func, String funcColumn, FilterNode node) { + return dataSource().queryColumnMap(entityType(), keyColumn, func, funcColumn, node); + } + + /** + * 查询符合过滤条件记录的GROUP BY聚合结果Map
+ * 等价SQL: SELECT keyColumn, FUNC{funcColumn} FROM {table} WHERE {filter node} GROUP BY {keyColumn}
+ * 如 queryColumnMapAsync(User.class, "name", FilterFunc.MAX, "createtime", (FilterNode)null) 等价于: SELECT name, MAX(createtime) FROM user GROUP BY + * name
+ * + * + * @param Key字段的数据类型 + * @param Number + * + * @param keyColumn Key字段 + * @param func 聚合函数 + * @param funcColumn 聚合字段 + * @param node 过滤条件 + * + * @return 聚合结果Map CompletableFuture + */ + default < K extends Serializable, N extends Number> CompletableFuture> queryColumnMapAsync(String keyColumn, FilterFunc func, String funcColumn, FilterNode node) { + return dataSource().queryColumnMapAsync(entityType(), keyColumn, func, funcColumn, node); + } + + /** + * 查询符合过滤条件记录的GROUP BY聚合结果Map
+ * 等价SQL: SELECT col1, FUNC{funcColumn1}, FUNC{funcColumn2} FROM {table} WHERE GROUP BY {col1}
+ * 如 queryColumnMapAsync(OrderRecord.class, Utility.ofArray(ColumnExpNode.div(ColumnFuncNode.sum("money"), 100), + * ColumnFuncNode.avg(ColumnExpNode.dec("money", 20)))), "targetid") + * 等价于: SELECT targetid, SUM(money) / 100, AVG(money - 20) FROM orderrecord GROUP BY targetid
+ * + * @param Key字段的数据类型 + * @param Number + * @param funcNodes ColumnNode[] + * @param groupByColumn GROUP BY字段 + * + * @return 聚合结果Map CompletableFuture + */ + default Map queryColumnMap(ColumnNode[] funcNodes, String groupByColumn) { + return dataSource().queryColumnMap(entityType(), funcNodes, groupByColumn); + } + + /** + * 查询符合过滤条件记录的GROUP BY聚合结果Map
+ * 等价SQL: SELECT col1, FUNC{funcColumn1}, FUNC{funcColumn2} FROM {table} GROUP BY {col1}
+ * 如 queryColumnMapAsync(OrderRecord.class, Utility.ofArray(ColumnExpNode.div(ColumnFuncNode.sum("money"), 100), + * ColumnFuncNode.avg(ColumnExpNode.dec("money", 20)))), "targetid") + * 等价于: SELECT targetid, SUM(money) / 100, AVG(money - 20) FROM orderrecord GROUP BY targetid
+ * + * @param Key字段的数据类型 + * @param Number + * @param funcNodes ColumnNode[] + * @param groupByColumn GROUP BY字段 + * + * @return 聚合结果Map CompletableFuture + */ + default < K extends Serializable, N extends Number> CompletableFuture> queryColumnMapAsync(ColumnNode[] funcNodes, String groupByColumn) { + return dataSource().queryColumnMapAsync(entityType(), funcNodes, groupByColumn); + } + + /** + * 查询符合过滤条件记录的GROUP BY聚合结果Map
+ * 等价SQL: SELECT col1, FUNC{funcColumn1}, FUNC{funcColumn2} FROM {table} WHERE {filter bean} GROUP BY {col1}
+ * 如 queryColumnMapAsync(OrderRecord.class, Utility.ofArray(ColumnExpNode.div(ColumnFuncNode.sum("money"), 100), + * ColumnFuncNode.avg(ColumnExpNode.dec("money", 20)))), "targetid", (FilterBean)null) + * 等价于: SELECT targetid, SUM(money) / 100, AVG(money - 20) FROM orderrecord GROUP BY targetid
+ * + * @param Key字段的数据类型 + * @param Number + * @param funcNodes ColumnNode[] + * @param groupByColumn GROUP BY字段 + * @param bean 过滤条件 + * + * @return 聚合结果Map CompletableFuture + */ + default Map queryColumnMap(ColumnNode[] funcNodes, String groupByColumn, FilterBean bean) { + return dataSource().queryColumnMap(entityType(), funcNodes, groupByColumn, bean); + } + + /** + * 查询符合过滤条件记录的GROUP BY聚合结果Map
+ * 等价SQL: SELECT col1, FUNC{funcColumn1}, FUNC{funcColumn2} FROM {table} WHERE {filter bean} GROUP BY {col1}
+ * 如 queryColumnMapAsync(OrderRecord.class, Utility.ofArray(ColumnExpNode.div(ColumnFuncNode.sum("money"), 100), + * ColumnFuncNode.avg(ColumnExpNode.dec("money", 20)))), "targetid", (FilterBean)null) + * 等价于: SELECT targetid, SUM(money) / 100, AVG(money - 20) FROM orderrecord GROUP BY targetid
+ * + * + * @param Key字段的数据类型 + * @param Number + * + * @param funcNodes ColumnNode[] + * @param groupByColumn GROUP BY字段 + * @param bean 过滤条件 + * + * @return 聚合结果Map CompletableFuture + */ + default CompletableFuture> queryColumnMapAsync(ColumnNode[] funcNodes, String groupByColumn, FilterBean bean) { + return dataSource().queryColumnMapAsync(entityType(), funcNodes, groupByColumn, bean); + } + + /** + * 查询符合过滤条件记录的GROUP BY聚合结果Map
+ * 等价SQL: SELECT col1, FUNC{funcColumn1}, FUNC{funcColumn2} FROM {table} WHERE {filter node} GROUP BY {col1}
+ * 如 queryColumnMapAsync(OrderRecord.class, Utility.ofArray(ColumnExpNode.div(ColumnFuncNode.sum("money"), 100), + * ColumnFuncNode.avg(ColumnExpNode.dec("money", 20)))), "targetid", (FilterNode)null) + * 等价于: SELECT targetid, SUM(money) / 100, AVG(money - 20) FROM orderrecord GROUP BY targetid
+ * + * + * @param Key字段的数据类型 + * @param Number + * + * @param funcNodes ColumnNode[] + * @param groupByColumn GROUP BY字段 + * @param node 过滤条件 + * + * @return 聚合结果Map CompletableFuture + */ + default Map queryColumnMap(ColumnNode[] funcNodes, String groupByColumn, FilterNode node) { + return dataSource().queryColumnMap(entityType(), funcNodes, groupByColumn, node); + } + + /** + * 查询符合过滤条件记录的GROUP BY聚合结果Map
+ * 等价SQL: SELECT col1, FUNC{funcColumn1}, FUNC{funcColumn2} FROM {table} WHERE {filter node} GROUP BY {col1}
+ * 如 queryColumnMapAsync(OrderRecord.class, Utility.ofArray(ColumnExpNode.div(ColumnFuncNode.sum("money"), 100), + * ColumnFuncNode.avg(ColumnExpNode.dec("money", 20)))), "targetid", (FilterNode)null) + * 等价于: SELECT targetid, SUM(money) / 100, AVG(money - 20) FROM orderrecord GROUP BY targetid
+ * + * + * @param Key字段的数据类型 + * @param Number + * + * @param funcNodes ColumnNode[] + * @param groupByColumn GROUP BY字段 + * @param node 过滤条件 + * + * @return 聚合结果Map CompletableFuture + */ + default < K extends Serializable, N extends Number> CompletableFuture> queryColumnMapAsync(ColumnNode[] funcNodes, String groupByColumn, FilterNode node) { + return dataSource().queryColumnMapAsync(entityType(), funcNodes, groupByColumn, node); + } + + /** + * 查询符合过滤条件记录的GROUP BY聚合结果Map
+ * 等价SQL: SELECT col1, col2, FUNC{funcColumn1}, FUNC{funcColumn2} FROM {table} GROUP BY {col1}, {col2}
+ * 如 queryColumnMapAsync(OrderRecord.class, Utility.ofArray(ColumnExpNode.div(ColumnFuncNode.sum("money"), 100), + * ColumnFuncNode.avg(ColumnExpNode.dec("money", 20)))), Utility.ofArray("fromid", "targetid")) + * 等价于: SELECT fromid, targetid, SUM(money) / 100, AVG(money - 20) FROM orderrecord GROUP BY fromid, targetid
+ * + * @param Key字段的数据类型 + * @param Number + * @param funcNodes ColumnNode[] + * @param groupByColumns GROUP BY字段 + * + * @return 聚合结果Map CompletableFuture + */ + default < K extends Serializable, N extends Number> Map queryColumnMap(ColumnNode[] funcNodes, String[] groupByColumns) { + return dataSource().queryColumnMap(entityType(), funcNodes, groupByColumns); + } + + /** + * 查询符合过滤条件记录的GROUP BY聚合结果Map
+ * 等价SQL: SELECT col1, col2, FUNC{funcColumn1}, FUNC{funcColumn2} FROM {table} GROUP BY {col1}, {col2}
+ * 如 queryColumnMapAsync(OrderRecord.class, Utility.ofArray(ColumnExpNode.div(ColumnFuncNode.sum("money"), 100), + * ColumnFuncNode.avg(ColumnExpNode.dec("money", 20)))), Utility.ofArray("fromid", "targetid")) + * 等价于: SELECT fromid, targetid, SUM(money) / 100, AVG(money - 20) FROM orderrecord GROUP BY fromid, targetid
+ * + * @param Key字段的数据类型 + * @param Number + * @param funcNodes ColumnNode[] + * @param groupByColumns GROUP BY字段 + * + * @return 聚合结果Map CompletableFuture + */ + default < K extends Serializable, N extends Number> CompletableFuture> queryColumnMapAsync(ColumnNode[] funcNodes, String[] groupByColumns) { + return dataSource().queryColumnMapAsync(entityType(), funcNodes, groupByColumns); + } + + /** + * 查询符合过滤条件记录的GROUP BY聚合结果Map
+ * 等价SQL: SELECT col1, col2, FUNC{funcColumn1}, FUNC{funcColumn2} FROM {table} WHERE {filter bean} GROUP BY {col1}, {col2}
+ * 如 queryColumnMapAsync(OrderRecord.class, Utility.ofArray(ColumnExpNode.div(ColumnFuncNode.sum("money"), 100), + * ColumnFuncNode.avg(ColumnExpNode.dec("money", 20)))), Utility.ofArray("fromid", "targetid"), (FilterBean)null) + * 等价于: SELECT fromid, targetid, SUM(money) / 100, AVG(money - 20) FROM orderrecord GROUP BY fromid, targetid
+ * + * @param Key字段的数据类型 + * @param Number + * @param funcNodes ColumnNode[] + * @param groupByColumns GROUP BY字段 + * @param bean 过滤条件 + * + * @return 聚合结果Map CompletableFuture + */ + default < K extends Serializable, N extends Number> Map queryColumnMap(ColumnNode[] funcNodes, String[] groupByColumns, FilterBean bean) { + return dataSource().queryColumnMap(entityType(), funcNodes, groupByColumns, bean); + } + + /** + * 查询符合过滤条件记录的GROUP BY聚合结果Map
+ * 等价SQL: SELECT col1, col2, FUNC{funcColumn1}, FUNC{funcColumn2} FROM {table} WHERE {filter bean} GROUP BY {col1}, {col2}
+ * 如 queryColumnMapAsync(OrderRecord.class, Utility.ofArray(ColumnExpNode.div(ColumnFuncNode.sum("money"), 100), + * ColumnFuncNode.avg(ColumnExpNode.dec("money", 20)))), Utility.ofArray("fromid", "targetid"), (FilterBean)null) + * 等价于: SELECT fromid, targetid, SUM(money) / 100, AVG(money - 20) FROM orderrecord GROUP BY fromid, targetid
+ * + * @param Key字段的数据类型 + * @param Number + * @param funcNodes ColumnNode[] + * @param groupByColumns GROUP BY字段 + * @param bean 过滤条件 + * + * @return 聚合结果Map CompletableFuture + */ + default < K extends Serializable, N extends Number> CompletableFuture> queryColumnMapAsync(ColumnNode[] funcNodes, String[] groupByColumns, FilterBean bean) { + return dataSource().queryColumnMapAsync(entityType(), funcNodes, groupByColumns, bean); + } + + /** + * 查询符合过滤条件记录的GROUP BY聚合结果Map
+ * 等价SQL: SELECT col1, col2, FUNC{funcColumn1}, FUNC{funcColumn2} FROM {table} WHERE {filter node} GROUP BY {col1}, {col2}
+ * 如 queryColumnMapAsync(OrderRecord.class, Utility.ofArray(ColumnExpNode.div(ColumnFuncNode.sum("money"), 100), + * ColumnFuncNode.avg(ColumnExpNode.dec("money", 20)))), Utility.ofArray("fromid", "targetid"), (FilterNode)null) + * 等价于: SELECT fromid, targetid, SUM(money) / 100, AVG(money - 20) FROM orderrecord GROUP BY fromid, targetid
+ * + * @param Key字段的数据类型 + * @param Number + * @param funcNodes ColumnNode[] + * @param groupByColumns GROUP BY字段 + * @param node 过滤条件 + * + * @return 聚合结果Map + */ + default < K extends Serializable, N extends Number> Map queryColumnMap(ColumnNode[] funcNodes, String[] groupByColumns, FilterNode node) { + return dataSource().queryColumnMap(entityType(), funcNodes, groupByColumns, node); + } + + /** + * 查询符合过滤条件记录的GROUP BY聚合结果Map
+ * 等价SQL: SELECT col1, col2, FUNC{funcColumn1}, FUNC{funcColumn2} FROM {table} WHERE {filter node} GROUP BY {col1}, {col2}
+ * 如 queryColumnMapAsync(OrderRecord.class, Utility.ofArray(ColumnExpNode.div(ColumnFuncNode.sum("money"), 100), + * ColumnFuncNode.avg(ColumnExpNode.dec("money", 20)))), Utility.ofArray("fromid", "targetid"), (FilterNode)null) + * 等价于: SELECT fromid, targetid, SUM(money) / 100, AVG(money - 20) FROM orderrecord GROUP BY fromid, targetid
+ * + * @param Key字段的数据类型 + * @param Number + * @param funcNodes ColumnNode[] + * @param groupByColumns GROUP BY字段 + * @param node 过滤条件 + * + * @return 聚合结果Map CompletableFuture + */ + default CompletableFuture> queryColumnMapAsync(ColumnNode[] funcNodes, String[] groupByColumns, FilterNode node) { + return dataSource().queryColumnMapAsync(entityType(), funcNodes, groupByColumns, node); + } + + //-----------------------findAsync---------------------------- + /** + * 获取指定主键值的单个记录, 返回null表示不存在值
+ * 等价SQL: SELECT * FROM {table} WHERE {primary} = {id}
+ * + * @param pk 主键值 + * + * @return Entity对象 + */ + default T find(Serializable pk) { + return dataSource().find(entityType(), pk); + } + + /** + * 获取指定主键值的单个记录, 返回null表示不存在值
+ * 等价SQL: SELECT * FROM {table} WHERE {primary} = {id}
+ * + * @param pk 主键值 + * + * @return Entity对象 CompletableFuture + */ + default CompletableFuture findAsync(Serializable pk) { + return dataSource().findAsync(entityType(), pk); + } + + /** + * 获取指定主键值的单个记录, 返回null表示不存在值
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {primary} = {id}
+ * + * @param selects 指定字段 + * @param pk 主键值 + * + * @return Entity对象 + */ + default T find(SelectColumn selects, Serializable pk) { + return dataSource().find(entityType(), selects, pk); + } + + /** + * 获取指定主键值的单个记录, 返回null表示不存在值
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {primary} = {id}
+ * + * @param selects 指定字段 + * @param pk 主键值 + * + * @return Entity对象CompletableFuture + */ + default CompletableFuture findAsync(SelectColumn selects, Serializable pk) { + return dataSource().findAsync(entityType(), selects, pk); + } + + /** + * 获取指定主键值的多个记录, 返回数组,数组长度与pks一样
+ * 等价SQL: SELECT * FROM {table} WHERE {primary} = {id1,id2, ···}
+ * + * + * @param pks 主键值集合 + * + * @return Entity对象 + */ + default T[] finds(Serializable... pks) { + return dataSource().finds(entityType(), pks); + } + + /** + * 获取指定主键值的多个记录, 返回数组,数组长度与pks一样
+ * 等价SQL: SELECT * FROM {table} WHERE {primary} = {id1,id2, ···}
+ * + * @param 主键泛型 + * + * @param pks 主键值集合 + * + * @return Entity对象 + */ + default T[] finds(Stream pks) { + return dataSource().finds(entityType(), pks); + } + + /** + * 获取指定主键值的多个记录, 返回数组,数组长度与pks一样
+ * 等价SQL: SELECT * FROM {table} WHERE {primary} = {id1,id2, ···}
+ * + * + * @param pks 主键值集合 + * + * @return Entity对象 CompletableFuture + */ + default CompletableFuture findsAsync(Serializable... pks) { + return dataSource().findsAsync(entityType(), pks); + } + + /** + * 获取指定主键值的多个记录, 返回数组,数组长度与pks一样
+ * 等价SQL: SELECT * FROM {table} WHERE {primary} = {id1,id2, ···}
+ * + * @param 主键泛型 + * + * + * @param pks 主键值集合 + * + * @return Entity对象 CompletableFuture + */ + default CompletableFuture findsAsync(Stream pks) { + return dataSource().findsAsync(entityType(), pks); + } + + /** + * 获取指定主键值的多个记录, 返回数组,数组长度与pks一样
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {primary} = {id1,id2, ···}
+ * + * + * @param selects 指定字段 + * @param pks 主键值集合 + * + * @return Entity对象 + */ + default T[] finds(SelectColumn selects, Serializable... pks) { + return dataSource().finds(entityType(), selects, pks); + } + + /** + * 获取指定主键值的多个记录, 返回数组,数组长度与pks一样
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {primary} = {id1,id2, ···}
+ * + * @param 主键泛型 + * @param selects 指定字段 + * @param pks 主键值集合 + * + * @return Entity对象 + */ + default T[] finds(SelectColumn selects, Stream pks) { + return dataSource().finds(entityType(), selects, pks); + } + + /** + * 获取指定主键值的多个记录, 返回数组,数组长度与pks一样
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {primary} = {id1,id2, ···}
+ * + * @param selects 指定字段 + * @param pks 主键值集合 + * + * @return Entity对象CompletableFuture + */ + default CompletableFuture findsAsync(SelectColumn selects, Serializable... pks) { + return dataSource().findsAsync(entityType(), selects, pks); + } + + /** + * 获取指定主键值的多个记录, 返回数组,数组长度与pks一样
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {primary} = {id1,id2, ···}
+ * + * @param 主键泛型 + * @param selects 指定字段 + * @param pks 主键值集合 + * + * @return Entity对象 + */ + default CompletableFuture findsAsync(SelectColumn selects, Stream pks) { + return dataSource().findsAsync(entityType(), selects, pks); + } + + /** + * 获取指定主键值的多个记录, 返回列表
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {primary} = {id1,id2, ···}
+ * + * @param 主键泛型 + * + * @param pks 主键值集合 + * + * @return Entity对象 + */ + default List findsList(Stream pks) { + return dataSource().findsList(entityType(), pks); + } + + /** + * 获取指定主键值的多个记录, 返回列表
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {primary} = {id1,id2, ···}
+ * + * @param 主键泛型 + * + * @param pks 主键值集合 + * + * @return Entity对象 + */ + default CompletableFuture> findsListAsync(Stream pks) { + return dataSource().findsListAsync(entityType(), pks); + } + + /** + * 获取符合过滤条件单个记录, 返回null表示不存在值
+ * 等价SQL: SELECT * FROM {table} WHERE {column} = {key}
+ * + * @param column 过滤字段名 + * @param colval 过滤字段值 + * + * @return Entity对象 + */ + default T find(String column, Serializable colval) { + return dataSource().find(entityType(), column, colval); + } + + /** + * 获取符合过滤条件单个记录, 返回null表示不存在值
+ * 等价SQL: SELECT * FROM {table} WHERE {column} = {key}
+ * + * @param Entity泛型 + * @param clazz Entity类 + * @param column 过滤字段名 + * @param colval 过滤字段值 + * + * @return Entity对象CompletableFuture + */ + default CompletableFuture findAsync(String column, Serializable colval) { + return dataSource().findAsync(entityType(), column, colval); + } + + /** + * 获取符合过滤条件单个记录, 返回null表示不存在值
+ * 等价SQL: SELECT * FROM {table} WHERE {column} = {key}
+ * + * + * + * @param func 更新值Lambda + * + * @return Entity对象 + */ + default T find(LambdaSupplier func) { + return dataSource().find(entityType(), func); + } + + /** + * 获取符合过滤条件单个记录, 返回null表示不存在值
+ * 等价SQL: SELECT * FROM {table} WHERE {column} = {key}
+ * + * + * + * @param func 更新值Lambda + * + * @return Entity对象 + */ + default CompletableFuture findAsync(LambdaSupplier func) { + return dataSource().findAsync(entityType(), func); + } + + /** + * 获取符合过滤条件单个记录, 返回null表示不存在值
+ * 等价SQL: SELECT * FROM {table} WHERE {filter bean}
+ * + * + * + * @param bean 过滤条件 + * + * @return Entity对象 + */ + default T find(FilterBean bean) { + return dataSource().find(entityType(), bean); + } + + /** + * 获取符合过滤条件单个记录, 返回null表示不存在值
+ * 等价SQL: SELECT * FROM {table} WHERE {filter bean}
+ * + * + * + * @param bean 过滤条件 + * + * @return Entity对象CompletableFuture + */ + default CompletableFuture findAsync(FilterBean bean) { + return dataSource().findAsync(entityType(), bean); + } + + /** + * 获取符合过滤条件单个记录, 返回null表示不存在值
+ * 等价SQL: SELECT * FROM {table} WHERE {filter node}
+ * + * + * + * @param node 过滤条件 + * + * @return Entity对象 + */ + default T find(FilterNode node) { + return dataSource().find(entityType(), node); + } + + /** + * 获取符合过滤条件单个记录, 返回null表示不存在值
+ * 等价SQL: SELECT * FROM {table} WHERE {filter node}
+ * + * + * + * @param node 过滤条件 + * + * @return Entity对象CompletableFuture + */ + default CompletableFuture findAsync(FilterNode node) { + return dataSource().findAsync(entityType(), node); + } + + /** + * 获取符合过滤条件单个记录, 返回null表示不存在值
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter bean}
+ * + * + * @param selects 指定字段 + * @param bean 过滤条件 + * + * @return Entity对象 + */ + default T find(SelectColumn selects, FilterBean bean) { + return dataSource().find(entityType(), selects, bean); + } + + /** + * 获取符合过滤条件单个记录, 返回null表示不存在值
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter bean}
+ * + * + * @param selects 指定字段 + * @param bean 过滤条件 + * + * @return Entity对象 CompletableFuture + */ + default CompletableFuture findAsync(SelectColumn selects, FilterBean bean) { + return dataSource().findAsync(entityType(), selects, bean); + } + + /** + * 获取符合过滤条件单个记录, 返回null表示不存在值
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter node}
+ * + * + * @param selects 指定字段 + * @param node 过滤条件 + * + * @return Entity对象 + */ + default T find(SelectColumn selects, FilterNode node) { + return dataSource().find(entityType(), selects, node); + } + + /** + * 获取符合过滤条件单个记录, 返回null表示不存在值
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter node}
+ * + * + * @param selects 指定字段 + * @param node 过滤条件 + * + * @return Entity对象 CompletableFuture + */ + default CompletableFuture findAsync(SelectColumn selects, FilterNode node) { + return dataSource().findAsync(entityType(), selects, node); + } + + /** + * 获取符合过滤条件单个记录的单个字段值, 返回null表示不存在值
+ * 等价SQL: SELECT {column} FROM {table} WHERE {primary} = {id}
+ * + * @param column 字段名 + * @param pk 主键值 + * + * @return Entity对象 + */ + default Serializable findColumn(String column, Serializable pk) { + return dataSource().findColumn(entityType(), column, pk); + } + + /** + * 获取符合过滤条件单个记录的单个字段值, 返回null表示不存在值
+ * 等价SQL: SELECT {column} FROM {table} WHERE {primary} = {id}
+ * + * @param column 字段名 + * @param pk 主键值 + * + * @return Entity对象 CompletableFuture + */ + default CompletableFuture findColumnAsync(String column, Serializable pk) { + return dataSource().findColumnAsync(entityType(), column, pk); + } + + /** + * 获取符合过滤条件单个记录的单个字段值, 返回null表示不存在值
+ * 等价SQL: SELECT {column} FROM {table} WHERE {filter bean}
+ * + * @param column 字段名 + * @param bean 过滤条件 + * + * @return 字段值 + */ + default Serializable findColumn(String column, FilterBean bean) { + return dataSource().findColumn(entityType(), column, bean); + } + + /** + * 获取符合过滤条件单个记录的单个字段值, 返回null表示不存在值
+ * 等价SQL: SELECT {column} FROM {table} WHERE {filter bean}
+ * + * @param column 字段名 + * @param bean 过滤条件 + * + * @return 字段值 CompletableFuture + */ + default CompletableFuture findColumnAsync(String column, FilterBean bean) { + return dataSource().findColumnAsync(entityType(), column, bean); + } + + /** + * 获取符合过滤条件单个记录的单个字段值, 返回null表示不存在值
+ * 等价SQL: SELECT {column} FROM {table} WHERE {filter node}
+ * + * @param column 字段名 + * @param node 过滤条件 + * + * @return 字段值 + */ + default Serializable findColumn(String column, FilterNode node) { + return dataSource().findColumn(entityType(), column, node); + } + + /** + * 获取符合过滤条件单个记录的单个字段值, 返回null表示不存在值
+ * 等价SQL: SELECT {column} FROM {table} WHERE {filter node}
+ * + * @param column 字段名 + * @param node 过滤条件 + * + * @return 字段值 CompletableFuture + */ + default CompletableFuture findColumnAsync(String column, FilterNode node) { + return dataSource().findColumnAsync(entityType(), column, node); + } + + /** + * 获取符合过滤条件单个记录的单个字段值, 不存在值则返回默认值
+ * 等价SQL: SELECT {column} FROM {table} WHERE {primary} = {id}
+ * + * @param column 字段名 + * @param defValue 默认值 + * @param pk 主键值 + * + * @return 字段值 + */ + default Serializable findColumn(String column, Serializable defValue, Serializable pk) { + return dataSource().findColumn(entityType(), column, defValue, pk); + } + + /** + * 获取符合过滤条件单个记录的单个字段值, 不存在值则返回默认值
+ * 等价SQL: SELECT {column} FROM {table} WHERE {primary} = {id}
+ * + * @param column 字段名 + * @param defValue 默认值 + * @param pk 主键值 + * + * @return 字段值 CompletableFuture + */ + default CompletableFuture findColumnAsync(String column, Serializable defValue, Serializable pk) { + return dataSource().findColumnAsync(entityType(), column, defValue, pk); + } + + /** + * 获取符合过滤条件单个记录的单个字段值, 不存在值则返回默认值
+ * 等价SQL: SELECT {column} FROM {table} WHERE {filter bean}
+ * + * @param column 字段名 + * @param defValue 默认值 + * @param bean 过滤条件 + * + * @return 字段值 + */ + default Serializable findColumn(String column, Serializable defValue, FilterBean bean) { + return dataSource().findColumn(entityType(), column, defValue, bean); + } + + /** + * 获取符合过滤条件单个记录的单个字段值, 不存在值则返回默认值
+ * 等价SQL: SELECT {column} FROM {table} WHERE {filter bean}
+ * + * @param column 字段名 + * @param defValue 默认值 + * @param bean 过滤条件 + * + * @return 字段值 CompletableFuture + */ + default CompletableFuture findColumnAsync(String column, Serializable defValue, FilterBean bean) { + return dataSource().findColumnAsync(entityType(), column, defValue, bean); + } + + /** + * 获取符合过滤条件单个记录的单个字段值, 不存在值则返回默认值
+ * 等价SQL: SELECT {column} FROM {table} WHERE {filter node}
+ * + * @param column 字段名 + * @param defValue 默认值 + * @param node 过滤条件 + * + * @return 字段值 + */ + default Serializable findColumn(String column, Serializable defValue, FilterNode node) { + return dataSource().findColumn(entityType(), column, defValue, node); + } + + /** + * 获取符合过滤条件单个记录的单个字段值, 不存在值则返回默认值
+ * 等价SQL: SELECT {column} FROM {table} WHERE {filter node}
+ * + * @param column 字段名 + * @param defValue 默认值 + * @param node 过滤条件 + * + * @return 字段值 CompletableFuture + */ + default CompletableFuture findColumnAsync(String column, Serializable defValue, FilterNode node) { + return dataSource().findColumnAsync(entityType(), column, defValue, node); + } + + /** + * 判断是否存在主键值的记录
+ * 等价SQL: SELECT COUNT(*) FROM {table} WHERE {primary} = {id}
+ * + * + * + * @param pk 主键值 + * + * @return 是否存在 + */ + default boolean exists(Serializable pk) { + return dataSource().exists(entityType(), pk); + } + + /** + * 判断是否存在主键值的记录
+ * 等价SQL: SELECT COUNT(*) FROM {table} WHERE {primary} = {id}
+ * + * + * + * @param pk 主键值 + * + * @return 是否存在CompletableFuture + */ + default CompletableFuture existsAsync(Serializable pk) { + return dataSource().existsAsync(entityType(), pk); + } + + /** + * 判断是否存在符合过滤条件的记录
+ * 等价SQL: SELECT COUNT(*) FROM {table} WHERE {filter bean}
+ * + * + * + * @param bean 过滤条件 + * + * @return 是否存在 + */ + default boolean exists(FilterBean bean) { + return dataSource().exists(entityType(), bean); + } + + /** + * 判断是否存在符合过滤条件的记录
+ * 等价SQL: SELECT COUNT(*) FROM {table} WHERE {filter bean}
+ * + * + * + * @param bean 过滤条件 + * + * @return 是否存在CompletableFuture + */ + default CompletableFuture existsAsync(FilterBean bean) { + return dataSource().existsAsync(entityType(), bean); + } + + /** + * 判断是否存在符合过滤条件的记录
+ * 等价SQL: SELECT COUNT(*) FROM {table} WHERE {filter node}
+ * + * + * + * @param node 过滤条件 + * + * @return 是否存在 + */ + default boolean exists(FilterNode node) { + return dataSource().exists(entityType(), node); + } + + /** + * 判断是否存在符合过滤条件的记录
+ * 等价SQL: SELECT COUNT(*) FROM {table} WHERE {filter node}
+ * + * + * + * @param node 过滤条件 + * + * @return 是否存在CompletableFuture + */ + default CompletableFuture existsAsync(FilterNode node) { + return dataSource().existsAsync(entityType(), node); + } + + //-----------------------list set---------------------------- + /** + * 查询符合过滤条件记录的某个字段Set集合
+ * 等价SQL: SELECT DISTINCT {selectedColumn} FROM {table} WHERE {column} = {key}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param column 过滤字段名 + * @param colval 过滤字段值 + * + * @return 字段值的集合 + */ + default Set queryColumnSet(String selectedColumn, String column, Serializable colval) { + return dataSource().queryColumnSet(selectedColumn, entityType(), column, colval); + } + + /** + * 查询符合过滤条件记录的某个字段Set集合
+ * 等价SQL: SELECT DISTINCT {selectedColumn} FROM {table} WHERE {column} = {key}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param column 过滤字段名 + * @param colval 过滤字段值 + * + * @return 字段值的集合CompletableFuture + */ + default CompletableFuture> queryColumnSetAsync(String selectedColumn, String column, Serializable colval) { + return dataSource().queryColumnSetAsync(selectedColumn, entityType(), column, colval); + } + + /** + * 查询符合过滤条件记录的某个字段Set集合
+ * 等价SQL: SELECT DISTINCT {selectedColumn} FROM {table} WHERE {filter bean}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param bean 过滤条件 + * + * @return 字段值的集合 + */ + default Set queryColumnSet(String selectedColumn, FilterBean bean) { + return dataSource().queryColumnSet(selectedColumn, entityType(), bean); + } + + /** + * 查询符合过滤条件记录的某个字段Set集合
+ * 等价SQL: SELECT DISTINCT {selectedColumn} FROM {table} WHERE {filter bean}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param bean 过滤条件 + * + * @return 字段值的集合CompletableFuture + */ + default CompletableFuture> queryColumnSetAsync(String selectedColumn, FilterBean bean) { + return dataSource().queryColumnSetAsync(selectedColumn, entityType(), bean); + } + + /** + * 查询符合过滤条件记录的某个字段Set集合
+ * 等价SQL: SELECT DISTINCT {selectedColumn} FROM {table} WHERE {filter node}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param node 过滤条件 + * + * @return 字段值的集合 + */ + default Set queryColumnSet(String selectedColumn, FilterNode node) { + return dataSource().queryColumnSet(selectedColumn, entityType(), node); + } + + /** + * 查询符合过滤条件记录的某个字段Set集合
+ * 等价SQL: SELECT DISTINCT {selectedColumn} FROM {table} WHERE {filter node}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param node 过滤条件 + * + * @return 字段值的集合CompletableFuture + */ + default CompletableFuture> queryColumnSetAsync(String selectedColumn, FilterNode node) { + return dataSource().queryColumnSetAsync(selectedColumn, entityType(), node); + } + + /** + * 查询符合过滤条件记录的某个字段Set集合
+ * 等价SQL: SELECT DISTINCT {selectedColumn} FROM {table} WHERE {filter bean} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param flipper 翻页对象 + * @param bean 过滤条件 + * + * @return 字段值的集合 + */ + default Set queryColumnSet(String selectedColumn, Flipper flipper, FilterBean bean) { + return dataSource().queryColumnSet(selectedColumn, entityType(), flipper, bean); + } + + /** + * 查询符合过滤条件记录的某个字段Set集合
+ * 等价SQL: SELECT DISTINCT {selectedColumn} FROM {table} WHERE {filter bean} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param flipper 翻页对象 + * @param bean 过滤条件 + * + * @return 字段值的集合CompletableFuture + */ + default CompletableFuture> queryColumnSetAsync(String selectedColumn, Flipper flipper, FilterBean bean) { + return dataSource().queryColumnSetAsync(selectedColumn, entityType(), flipper, bean); + } + + /** + * 查询符合过滤条件记录的某个字段Set集合
+ * 等价SQL: SELECT DISTINCT {selectedColumn} FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param flipper 翻页对象 + * @param node 过滤条件 + * + * @return 字段值的集合 + */ + default Set queryColumnSet(String selectedColumn, Flipper flipper, FilterNode node) { + return dataSource().queryColumnSet(selectedColumn, entityType(), flipper, node); + } + + /** + * 查询符合过滤条件记录的某个字段Set集合
+ * 等价SQL: SELECT DISTINCT {selectedColumn} FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param flipper 翻页对象 + * @param node 过滤条件 + * + * @return 字段值的集合CompletableFuture + */ + default CompletableFuture> queryColumnSetAsync(String selectedColumn, Flipper flipper, FilterNode node) { + return dataSource().queryColumnSetAsync(selectedColumn, entityType(), flipper, node); + } + + /** + * 查询符合过滤条件记录的某个字段List集合
+ * 等价SQL: SELECT {selectedColumn} FROM {table} WHERE {column} = {key}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param column 过滤字段名 + * @param colval 过滤字段值 + * + * @return 字段值的集合 + */ + default List queryColumnList(String selectedColumn, String column, Serializable colval) { + return dataSource().queryColumnList(selectedColumn, entityType(), column, colval); + } + + /** + * 查询符合过滤条件记录的某个字段List集合
+ * 等价SQL: SELECT {selectedColumn} FROM {table} WHERE {column} = {key}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param column 过滤字段名 + * @param colval 过滤字段值 + * + * @return 字段值的集合CompletableFuture + */ + default CompletableFuture> queryColumnListAsync(String selectedColumn, String column, Serializable colval) { + return dataSource().queryColumnListAsync(selectedColumn, entityType(), column, colval); + } + + /** + * 查询符合过滤条件记录的某个字段List集合
+ * 等价SQL: SELECT {selectedColumn} FROM {table} WHERE {filter bean}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param bean 过滤条件 + * + * @return 字段值的集合 + */ + default List queryColumnList(String selectedColumn, FilterBean bean) { + return dataSource().queryColumnList(selectedColumn, entityType(), bean); + } + + /** + * 查询符合过滤条件记录的某个字段List集合
+ * 等价SQL: SELECT {selectedColumn} FROM {table} WHERE {filter bean}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param bean 过滤条件 + * + * @return 字段值的集合CompletableFuture + */ + default CompletableFuture> queryColumnListAsync(String selectedColumn, FilterBean bean) { + return dataSource().queryColumnListAsync(selectedColumn, entityType(), bean); + } + + /** + * 查询符合过滤条件记录的某个字段List集合
+ * 等价SQL: SELECT {selectedColumn} FROM {table} WHERE {filter node}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param node 过滤条件 + * + * @return 字段值的集合 + */ + default List queryColumnList(String selectedColumn, FilterNode node) { + return dataSource().queryColumnList(selectedColumn, entityType(), node); + } + + /** + * 查询符合过滤条件记录的某个字段List集合
+ * 等价SQL: SELECT {selectedColumn} FROM {table} WHERE {filter node}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param node 过滤条件 + * + * @return 字段值的集合CompletableFuture + */ + default CompletableFuture> queryColumnListAsync(String selectedColumn, FilterNode node) { + return dataSource().queryColumnListAsync(selectedColumn, entityType(), node); + } + + /** + * 查询符合过滤条件记录的某个字段List集合
+ * 等价SQL: SELECT {selectedColumn} FROM {table} WHERE {filter bean} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param flipper 翻页对象 + * @param bean 过滤条件 + * + * @return 字段值的集合 + */ + default List queryColumnList(String selectedColumn, Flipper flipper, FilterBean bean) { + return dataSource().queryColumnList(selectedColumn, entityType(), flipper, bean); + } + + /** + * 查询符合过滤条件记录的某个字段List集合
+ * 等价SQL: SELECT {selectedColumn} FROM {table} WHERE {filter bean} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param flipper 翻页对象 + * @param bean 过滤条件 + * + * @return 字段值的集合CompletableFuture + */ + default CompletableFuture> queryColumnListAsync(String selectedColumn, Flipper flipper, FilterBean bean) { + return dataSource().queryColumnListAsync(selectedColumn, entityType(), flipper, bean); + } + + /** + * 查询符合过滤条件记录的某个字段List集合
+ * 等价SQL: SELECT {selectedColumn} FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param flipper 翻页对象 + * @param node 过滤条件 + * + * @return 字段值的集合 + */ + default List queryColumnList(String selectedColumn, Flipper flipper, FilterNode node) { + return dataSource().queryColumnList(selectedColumn, entityType(), flipper, node); + } + + /** + * 查询符合过滤条件记录的某个字段List集合
+ * 等价SQL: SELECT {selectedColumn} FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param flipper 翻页对象 + * @param node 过滤条件 + * + * @return 字段值的集合CompletableFuture + */ + default CompletableFuture> queryColumnListAsync(String selectedColumn, Flipper flipper, FilterNode node) { + return dataSource().queryColumnListAsync(selectedColumn, entityType(), flipper, node); + } + + /** + * 查询符合过滤条件记录的某个字段Sheet集合
+ * 等价SQL: SELECT {selectedColumn} FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param flipper 翻页对象 + * @param bean 过滤条件 + * + * @return 字段值的集合 + */ + default Sheet queryColumnSheet(String selectedColumn, Flipper flipper, FilterBean bean) { + return dataSource().queryColumnSheet(selectedColumn, entityType(), flipper, bean); + } + + /** + * 查询符合过滤条件记录的某个字段Sheet集合
+ * 等价SQL: SELECT {selectedColumn} FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param flipper 翻页对象 + * @param bean 过滤条件 + * + * @return 字段值的集合CompletableFuture + */ + default CompletableFuture> queryColumnSheetAsync(String selectedColumn, Flipper flipper, FilterBean bean) { + return dataSource().queryColumnSheetAsync(selectedColumn, entityType(), flipper, bean); + } + + /** + * 查询符合过滤条件记录的某个字段Sheet集合
+ * 等价SQL: SELECT {selectedColumn} FROM {table} WHERE {filter bean} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param flipper 翻页对象 + * @param node 过滤条件 + * + * @return 字段值的集合 + */ + default Sheet queryColumnSheet(String selectedColumn, Flipper flipper, FilterNode node) { + return dataSource().queryColumnSheet(selectedColumn, entityType(), flipper, node); + } + + /** + * 查询符合过滤条件记录的某个字段Sheet集合
+ * 等价SQL: SELECT {selectedColumn} FROM {table} WHERE {filter bean} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * @param 字段类型 + * @param selectedColumn 指定字段 + * @param flipper 翻页对象 + * @param node 过滤条件 + * + * @return 字段值的集合CompletableFuture + */ + default CompletableFuture> queryColumnSheetAsync(String selectedColumn, Flipper flipper, FilterNode node) { + return dataSource().queryColumnSheetAsync(selectedColumn, entityType(), flipper, node); + } + + /** + * 查询符合过滤条件记录的List转Map集合, key=主键值, value=Entity对象
+ * 等价SQL: SELECT * FROM {table} WHERE id IN {ids}
+ * + * @param 主键泛型 + * @param keyStream 主键Stream + * + * @return Entity的集合 + */ + default Map queryMap(Stream keyStream) { + return dataSource().queryMap(entityType(), keyStream); + } + + /** + * 查询符合过滤条件记录的List转Map集合, key=主键值, value=Entity对象
+ * 等价SQL: SELECT * FROM {table} WHERE id IN {ids}
+ * + * @param 主键泛型 + * @param keyStream 主键Stream + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> queryMapAsync(Stream keyStream) { + return dataSource().queryMapAsync(entityType(), keyStream); + } + + /** + * 查询符合过滤条件记录的List转Map集合, key=主键值, value=Entity对象
+ * 等价SQL: SELECT * FROM {table} WHERE {filter node}
+ * + * @param 主键泛型 + * + * + * @param bean FilterBean + * + * @return Entity的集合 + */ + default Map queryMap(FilterBean bean) { + return dataSource().queryMap(entityType(), bean); + } + + /** + * 查询符合过滤条件记录的List转Map集合, key=主键值, value=Entity对象
+ * 等价SQL: SELECT * FROM {table} WHERE {filter node}
+ * + * @param 主键泛型 + * + * + * @param bean FilterBean + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> queryMapAsync(FilterBean bean) { + return dataSource().queryMapAsync(entityType(), bean); + } + + /** + * 查询符合过滤条件记录的List转Map集合, key=主键值, value=Entity对象
+ * 等价SQL: SELECT * FROM {table} WHERE {filter node}
+ * + * @param 主键泛型 + * + * + * @param node FilterNode + * + * @return Entity的集合 + */ + default Map queryMap(FilterNode node) { + return dataSource().queryMap(entityType(), node); + } + + /** + * 查询符合过滤条件记录的List转Map集合, key=主键值, value=Entity对象
+ * 等价SQL: SELECT * FROM {table} WHERE {filter node}
+ * + * @param 主键泛型 + * + * + * @param node FilterNode + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> queryMapAsync(FilterNode node) { + return dataSource().queryMapAsync(entityType(), node); + } + + /** + * 查询符合过滤条件记录的List转Map集合, key=主键值, value=Entity对象
+ * 等价SQL: SELECT * FROM {table} WHERE id IN {ids}
+ * + * @param 主键泛型 + * @param selects 指定字段 + * @param keyStream 主键Stream + * + * @return Entity的集合 + */ + default Map queryMap(SelectColumn selects, Stream keyStream) { + return dataSource().queryMap(entityType(), selects, keyStream); + } + + /** + * 查询符合过滤条件记录的List转Map集合, key=主键值, value=Entity对象
+ * 等价SQL: SELECT * FROM {table} WHERE id IN {ids}
+ * + * @param 主键泛型 + * @param selects 指定字段 + * @param keyStream 主键Stream + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> queryMapAsync(SelectColumn selects, Stream keyStream) { + return dataSource().queryMapAsync(entityType(), selects, keyStream); + } + + /** + * 查询符合过滤条件记录的List转Map集合, key=主键值, value=Entity对象
+ * 等价SQL: SELECT * FROM {table} WHERE {filter node}
+ * + * @param 主键泛型 + * + * @param selects 指定字段 + * @param bean FilterBean + * + * @return Entity的集合 + */ + default Map queryMap(SelectColumn selects, FilterBean bean) { + return dataSource().queryMap(entityType(), selects, bean); + } + + /** + * 查询符合过滤条件记录的List转Map集合, key=主键值, value=Entity对象
+ * 等价SQL: SELECT * FROM {table} WHERE {filter node}
+ * + * @param 主键泛型 + * + * @param selects 指定字段 + * @param bean FilterBean + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> queryMapAsync(SelectColumn selects, FilterBean bean) { + return dataSource().queryMapAsync(entityType(), selects, bean); + } + + /** + * 查询符合过滤条件记录的List转Map集合, key=主键值, value=Entity对象
+ * 等价SQL: SELECT * FROM {table} WHERE {filter node}
+ * + * @param 主键泛型 + * + * @param selects 指定字段 + * @param node FilterNode + * + * @return Entity的集合 + */ + default Map queryMap(SelectColumn selects, FilterNode node) { + return dataSource().queryMap(entityType(), selects, node); + } + + /** + * 查询符合过滤条件记录的List转Map集合, key=主键值, value=Entity对象
+ * 等价SQL: SELECT * FROM {table} WHERE {filter node}
+ * + * @param 主键泛型 + * @param selects 指定字段 + * @param node FilterNode + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> queryMapAsync(SelectColumn selects, FilterNode node) { + return dataSource().queryMapAsync(entityType(), selects, node); + } + + /** + * 查询符合过滤条件记录的Set集合
+ * 等价SQL: SELECT DISTINCT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * @param column 过滤字段名 + * @param colval 过滤字段值 + * + * @return Entity的集合 + */ + default Set querySet(String column, Serializable colval) { + return dataSource().querySet(entityType(), column, colval); + } + + /** + * 查询符合过滤条件记录的Set集合
+ * 等价SQL: SELECT DISTINCT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * @param column 过滤字段名 + * @param colval 过滤字段值 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> querySetAsync(String column, Serializable colval) { + return dataSource().querySetAsync(entityType(), column, colval); + } + + /** + * 查询符合过滤条件记录的Set集合
+ * 等价SQL: SELECT DISTINCT * FROM {table} WHERE {filter bean}
+ * + * + * + * @param bean 过滤条件 + * + * @return Entity的集合 + */ + default Set querySet(FilterBean bean) { + return dataSource().querySet(entityType(), bean); + } + + /** + * 查询符合过滤条件记录的Set集合
+ * 等价SQL: SELECT DISTINCT * FROM {table} WHERE {filter bean}
+ * + * + * + * @param bean 过滤条件 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> querySetAsync(FilterBean bean) { + return dataSource().querySetAsync(entityType(), bean); + } + + /** + * 查询记录的Set集合
+ * 等价SQL: SELECT DISTINCT * FROM {table}
+ * + * @return Entity的集合 + */ + default Set querySet() { + return dataSource().querySet(entityType()); + } + + /** + * 查询符合过滤条件记录的Set集合
+ * 等价SQL: SELECT DISTINCT * FROM {table} WHERE {filter node}
+ * + * + * + * @param node 过滤条件 + * + * @return Entity的集合 + */ + default Set querySet(FilterNode node) { + return dataSource().querySet(entityType(), node); + } + + /** + * 查询记录的Set集合
+ * 等价SQL: SELECT DISTINCT * FROM {table}
+ * + * + * + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> querySetAsync() { + return dataSource().querySetAsync(entityType()); + } + + /** + * 查询符合过滤条件记录的Set集合
+ * 等价SQL: SELECT DISTINCT * FROM {table} WHERE {filter node}
+ * + * + * + * @param node 过滤条件 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> querySetAsync(FilterNode node) { + return dataSource().querySetAsync(entityType(), node); + } + + /** + * 查询符合过滤条件记录的Set集合
+ * 等价SQL: SELECT DISTINCT {column1},{column2}, ··· FROM {table} WHERE {filter bean}
+ * + * + * @param selects 指定字段 + * @param bean 过滤条件 + * + * @return Entity的集合 + */ + default Set querySet(SelectColumn selects, FilterBean bean) { + return dataSource().querySet(entityType(), selects, bean); + } + + /** + * 查询符合过滤条件记录的Set集合
+ * 等价SQL: SELECT DISTINCT {column1},{column2}, ··· FROM {table} WHERE {filter bean}
+ * + * + * @param selects 指定字段 + * @param bean 过滤条件 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> querySetAsync(SelectColumn selects, FilterBean bean) { + return dataSource().querySetAsync(entityType(), selects, bean); + } + + /** + * 查询符合过滤条件记录的Set集合
+ * 等价SQL: SELECT DISTINCT {column1},{column2}, ··· FROM {table} WHERE {filter node}
+ * + * + * @param selects 指定字段 + * @param node 过滤条件 + * + * @return Entity的集合 + */ + default Set querySet(SelectColumn selects, FilterNode node) { + return dataSource().querySet(entityType(), selects, node); + } + + /** + * 查询符合过滤条件记录的Set集合
+ * 等价SQL: SELECT DISTINCT {column1},{column2}, ··· FROM {table} WHERE {filter node}
+ * + * + * @param selects 指定字段 + * @param node 过滤条件 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> querySetAsync(SelectColumn selects, FilterNode node) { + return dataSource().querySetAsync(entityType(), selects, node); + } + + /** + * 查询符合过滤条件记录的Set集合
+ * 等价SQL: SELECT DISTINCT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * @param flipper 翻页对象 + * @param column 过滤字段名 + * @param colval 过滤字段值 + * + * @return Entity的集合 + */ + default Set querySet(Flipper flipper, String column, Serializable colval) { + return dataSource().querySet(entityType(), flipper, column, colval); + } + + /** + * 查询符合过滤条件记录的Set集合
+ * 等价SQL: SELECT DISTINCT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param flipper 翻页对象 + * @param column 过滤字段名 + * @param colval 过滤字段值 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> querySetAsync(Flipper flipper, String column, Serializable colval) { + return dataSource().querySetAsync(entityType(), flipper, column, colval); + } + + /** + * 查询符合过滤条件记录的Set集合
+ * 等价SQL: SELECT DISTINCT * FROM {table} WHERE {filter bean} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param flipper 翻页对象 + * @param bean 过滤条件 + * + * @return Entity的集合 + */ + default Set querySet(Flipper flipper, FilterBean bean) { + return dataSource().querySet(entityType(), flipper, bean); + } + + /** + * 查询符合过滤条件记录的Set集合
+ * 等价SQL: SELECT DISTINCT * FROM {table} WHERE {filter bean} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param flipper 翻页对象 + * @param bean 过滤条件 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> querySetAsync(Flipper flipper, FilterBean bean) { + return dataSource().querySetAsync(entityType(), flipper, bean); + } + + /** + * 查询符合过滤条件记录的Set集合
+ * 等价SQL: SELECT DISTINCT * FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param flipper 翻页对象 + * @param node 过滤条件 + * + * @return Entity的集合 + * + */ + default Set querySet(Flipper flipper, FilterNode node) { + return dataSource().querySet(entityType(), flipper, node); + } + + /** + * 查询符合过滤条件记录的Set集合
+ * 等价SQL: SELECT DISTINCT * FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param flipper 翻页对象 + * @param node 过滤条件 + * + * @return Entity的集合 + * + */ + default CompletableFuture> querySetAsync(Flipper flipper, FilterNode node) { + return dataSource().querySetAsync(entityType(), flipper, node); + } + + /** + * 查询符合过滤条件记录的Set集合
+ * 等价SQL: SELECT DISTINCT {column1},{column2}, ··· FROM {table} WHERE {filter bean} ORDER BY {flipper.sort} LIMIT {flipper.limit} + *
+ * + * + * + * @param selects 指定字段 + * @param flipper 翻页对象 + * @param bean 过滤条件 + * + * @return Entity的集合 + */ + default Set querySet(SelectColumn selects, Flipper flipper, FilterBean bean) { + return dataSource().querySet(entityType(), selects, flipper, bean); + } + + /** + * 查询符合过滤条件记录的Set集合
+ * 等价SQL: SELECT DISTINCT {column1},{column2}, ··· FROM {table} WHERE {filter bean} ORDER BY {flipper.sort} LIMIT {flipper.limit} + *
+ * + * + * + * @param selects 指定字段 + * @param flipper 翻页对象 + * @param bean 过滤条件 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> querySetAsync(SelectColumn selects, Flipper flipper, FilterBean bean) { + return dataSource().querySetAsync(entityType(), selects, flipper, bean); + } + + /** + * 查询符合过滤条件记录的Set集合
+ * 等价SQL: SELECT DISTINCT {column1},{column2}, ··· FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit} + *
+ * + * + * + * @param selects 指定字段 + * @param flipper 翻页对象 + * @param node 过滤条件 + * + * @return Entity的集合 + */ + default Set querySet(SelectColumn selects, Flipper flipper, FilterNode node) { + return dataSource().querySet(entityType(), selects, flipper, node); + } + + /** + * 查询符合过滤条件记录的Set集合
+ * 等价SQL: SELECT DISTINCT {column1},{column2}, ··· FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit} + *
+ * + * + * + * @param selects 指定字段 + * @param flipper 翻页对象 + * @param node 过滤条件 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> querySetAsync(SelectColumn selects, Flipper flipper, FilterNode node) { + return dataSource().querySetAsync(entityType(), selects, flipper, node); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * @param column 过滤字段名 + * @param colval 过滤字段值 + * + * @return Entity的集合 + */ + default List queryList(String column, Serializable colval) { + return dataSource().queryList(entityType(), column, colval); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * @param column 过滤字段名 + * @param colval 过滤字段值 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> queryListAsync(String column, Serializable colval) { + return dataSource().queryListAsync(entityType(), column, colval); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT * FROM {table} WHERE {filter bean}
+ * + * + * + * @param bean 过滤条件 + * + * @return Entity的集合 + */ + default List queryList(FilterBean bean) { + return dataSource().queryList(entityType(), bean); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT * FROM {table} WHERE {filter bean}
+ * + * + * + * @param bean 过滤条件 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> queryListAsync(FilterBean bean) { + return dataSource().queryListAsync(entityType(), bean); + } + + /** + * 查询记录的List集合
+ * 等价SQL: SELECT * FROM {table}
+ * + * + * + * + * @return Entity的集合 + */ + default List queryList() { + return dataSource().queryList(entityType()); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT * FROM {table} WHERE {filter node}
+ * + * + * + * @param node 过滤条件 + * + * @return Entity的集合 + */ + default List queryList(FilterNode node) { + return dataSource().queryList(entityType(), node); + } + + /** + * 查询记录的List集合
+ * 等价SQL: SELECT * FROM {table}
+ * + * + * + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> queryListAsync() { + return dataSource().queryListAsync(entityType()); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT * FROM {table} WHERE {filter node}
+ * + * + * + * @param node 过滤条件 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> queryListAsync(FilterNode node) { + return dataSource().queryListAsync(entityType(), node); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter bean}
+ * + * + * + * @param selects 指定字段 + * @param bean 过滤条件 + * + * @return Entity的集合 + */ + default List queryList(SelectColumn selects, FilterBean bean) { + return dataSource().queryList(entityType(), selects, bean); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter bean}
+ * + * + * + * @param selects 指定字段 + * @param bean 过滤条件 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> queryListAsync(SelectColumn selects, FilterBean bean) { + return dataSource().queryListAsync(entityType(), selects, bean); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter node}
+ * + * + * + * @param selects 指定字段 + * @param node 过滤条件 + * + * @return Entity的集合 + */ + default List queryList(SelectColumn selects, FilterNode node) { + return dataSource().queryList(entityType(), selects, node); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter node}
+ * + * + * + * @param selects 指定字段 + * @param node 过滤条件 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> queryListAsync(SelectColumn selects, FilterNode node) { + return dataSource().queryListAsync(entityType(), selects, node); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param flipper 翻页对象 + * @param column 过滤字段名 + * @param colval 过滤字段值 + * + * @return Entity的集合 + */ + default List queryList(Flipper flipper, String column, Serializable colval) { + return dataSource().queryList(entityType(), flipper, column, colval); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param flipper 翻页对象 + * @param column 过滤字段名 + * @param colval 过滤字段值 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> queryListAsync(Flipper flipper, String column, Serializable colval) { + return dataSource().queryListAsync(entityType(), flipper, column, colval); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT * FROM {table} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param flipper 翻页对象 + * + * @return Entity的集合 + */ + default List queryList(Flipper flipper) { + return dataSource().queryList(entityType(), flipper); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT * FROM {table} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param flipper 翻页对象 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> queryListAsync(Flipper flipper) { + return dataSource().queryListAsync(entityType(), flipper); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT * FROM {table} WHERE {filter bean} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param flipper 翻页对象 + * @param bean 过滤条件 + * + * @return Entity的集合 + */ + default List queryList(Flipper flipper, FilterBean bean) { + return dataSource().queryList(entityType(), flipper, bean); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT * FROM {table} WHERE {filter bean} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param flipper 翻页对象 + * @param bean 过滤条件 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> queryListAsync(Flipper flipper, FilterBean bean) { + return dataSource().queryListAsync(entityType(), flipper, bean); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT * FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param flipper 翻页对象 + * @param node 过滤条件 + * + * @return Entity的集合 + * + */ + default List queryList(Flipper flipper, FilterNode node) { + return dataSource().queryList(entityType(), flipper, node); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT * FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param flipper 翻页对象 + * @param node 过滤条件 + * + * @return Entity的集合 + * + */ + default CompletableFuture> queryListAsync(Flipper flipper, FilterNode node) { + return dataSource().queryListAsync(entityType(), flipper, node); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param selects 指定字段 + * @param flipper 翻页对象 + * + * @return Entity的集合 + */ + default List queryList(SelectColumn selects, Flipper flipper) { + return dataSource().queryList(entityType(), selects, flipper); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param selects 指定字段 + * @param flipper 翻页对象 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> queryListAsync(SelectColumn selects, Flipper flipper) { + return dataSource().queryListAsync(entityType(), selects, flipper); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter bean} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param selects 指定字段 + * @param flipper 翻页对象 + * @param bean 过滤条件 + * + * @return Entity的集合 + */ + default List queryList(SelectColumn selects, Flipper flipper, FilterBean bean) { + return dataSource().queryList(entityType(), selects, flipper, bean); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter bean} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param selects 指定字段 + * @param flipper 翻页对象 + * @param bean 过滤条件 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> queryListAsync(SelectColumn selects, Flipper flipper, FilterBean bean) { + return dataSource().queryListAsync(entityType(), selects, flipper, bean); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param selects 指定字段 + * @param flipper 翻页对象 + * @param node 过滤条件 + * + * @return Entity的集合 + */ + default List queryList(SelectColumn selects, Flipper flipper, FilterNode node) { + return dataSource().queryList(entityType(), selects, flipper, node); + } + + /** + * 查询符合过滤条件记录的List集合
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param selects 指定字段 + * @param flipper 翻页对象 + * @param node 过滤条件 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> queryListAsync(SelectColumn selects, Flipper flipper, FilterNode node) { + return dataSource().queryListAsync(entityType(), selects, flipper, node); + } + + //-----------------------sheet---------------------------- + /** + * 查询符合过滤条件记录的Sheet集合
+ * 等价SQL: SELECT * FROM {table} WHERE {filter bean} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param flipper 翻页对象 + * @param bean 过滤条件 + * + * @return Entity的集合 + */ + default Sheet querySheet(Flipper flipper, FilterBean bean) { + return dataSource().querySheet(entityType(), flipper, bean); + } + + /** + * 查询符合过滤条件记录的Sheet集合
+ * 等价SQL: SELECT * FROM {table} WHERE {filter bean} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param flipper 翻页对象 + * @param bean 过滤条件 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> querySheetAsync(Flipper flipper, FilterBean bean) { + return dataSource().querySheetAsync(entityType(), flipper, bean); + } + + /** + * 查询符合过滤条件记录的Sheet集合
+ * 等价SQL: SELECT * FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param flipper 翻页对象 + * @param node 过滤条件 + * + * @return Entity的集合 + */ + default Sheet querySheet(Flipper flipper, FilterNode node) { + return dataSource().querySheet(entityType(), flipper, node); + } + + /** + * 查询符合过滤条件记录的Sheet集合
+ * 等价SQL: SELECT * FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param flipper 翻页对象 + * @param node 过滤条件 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> querySheetAsync(Flipper flipper, FilterNode node) { + return dataSource().querySheetAsync(entityType(), flipper, node); + } + + /** + * 查询符合过滤条件记录的Sheet集合
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter bean} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param selects 指定字段 + * @param flipper 翻页对象 + * @param bean 过滤条件 + * + * @return Entity的集合 + */ + default Sheet querySheet(SelectColumn selects, Flipper flipper, FilterBean bean) { + return dataSource().querySheet(entityType(), selects, flipper, bean); + } + + /** + * 查询符合过滤条件记录的Sheet集合
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter bean} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param selects 指定字段 + * @param flipper 翻页对象 + * @param bean 过滤条件 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> querySheetAsync(SelectColumn selects, Flipper flipper, FilterBean bean) { + return dataSource().querySheetAsync(entityType(), selects, flipper, bean); + } + + /** + * 查询符合过滤条件记录的Sheet集合
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param selects 指定字段 + * @param flipper 翻页对象 + * @param node 过滤条件 + * + * @return Entity的集合 + */ + default Sheet querySheet(SelectColumn selects, Flipper flipper, FilterNode node) { + return dataSource().querySheet(entityType(), selects, flipper, node); + } + + /** + * 查询符合过滤条件记录的Sheet集合
+ * 等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}
+ * + * + * + * @param selects 指定字段 + * @param flipper 翻页对象 + * @param node 过滤条件 + * + * @return Entity的集合CompletableFuture + */ + default CompletableFuture> querySheetAsync(SelectColumn selects, Flipper flipper, FilterNode node) { + return dataSource().querySheetAsync(entityType(), selects, flipper, node); + } + + //----------------------- native ---------------------------- + /** + * 执行多条原生无参数的sql + * + * @param sqls 无参数的sql语句 + * + * @return 执行条数 + */ + default int[] nativeUpdates(String... sqls) { + return dataSource().nativeUpdates(sqls); + } + + /** + * 执行多条原生无参数的sql + * + * @param sqls 无参数的sql语句 + * + * @return 执行条数 + */ + default CompletableFuture nativeUpdatesAsync(String... sqls) { + return dataSource().nativeUpdatesAsync(sqls); + } + + /** + * 执行原生无参数的sql + * + * @param sql 无参数的sql语句 + * + * @return 执行条数 + */ + default int nativeUpdate(String sql) { + return dataSource().nativeUpdate(sql); + } + + /** + * 执行原生无参数的sql + * + * @param sql 无参数的sql语句 + * + * @return 执行条数 + */ + default CompletableFuture nativeUpdateAsync(String sql) { + return dataSource().nativeUpdateAsync(sql); + } + + /** + * 执行原生带参数的sql + * + * @param sql 带参数的sql语句 + * @param params 参数值集合 + * + * @return 执行条数 + */ + default int nativeUpdate(String sql, Map params) { + return dataSource().nativeUpdate(sql, params); + } + + /** + * 执行原生带参数的sql + * + * @param sql 带参数的sql语句 + * @param params 参数值集合 + * + * @return 执行条数 + */ + default CompletableFuture nativeUpdateAsync(String sql, Map params) { + return dataSource().nativeUpdateAsync(sql, params); + } + + /** + * 执行原生带参数的sql + * + * @param sql 带参数的sql语句 + * @param bean 参数值集合 + * + * @return 执行条数 + */ + default int nativeUpdate(String sql, Serializable bean) { + return dataSource().nativeUpdate(sql, bean); + } + + /** + * 执行原生带参数的sql + * + * @param sql 带参数的sql语句 + * @param bean 参数值集合 + * + * @return 执行条数 + */ + default CompletableFuture nativeUpdateAsync(String sql, Serializable bean) { + return dataSource().nativeUpdateAsync(sql, bean); + } + +} diff --git a/src/main/java/org/redkale/source/spi/DataSqlMapperBuilder.java b/src/main/java/org/redkale/source/spi/DataSqlMapperBuilder.java new file mode 100644 index 000000000..2ee005156 --- /dev/null +++ b/src/main/java/org/redkale/source/spi/DataSqlMapperBuilder.java @@ -0,0 +1,21 @@ +/* + * + */ +package org.redkale.source.spi; + +import java.lang.reflect.Field; +import org.redkale.inject.ResourceFactory; +import org.redkale.inject.ResourceTypeLoader; + +/** + * + * @author zhangjx + */ +public class DataSqlMapperBuilder implements ResourceTypeLoader { + + @Override + public Object load(ResourceFactory factory, String srcResourceName, Object srcObj, String resourceName, Field field, Object attachment) { + return null; + } + +} diff --git a/src/main/java/org/redkale/source/spi/SourceModuleEngine.java b/src/main/java/org/redkale/source/spi/SourceModuleEngine.java index d9fee3b04..ee7fba212 100644 --- a/src/main/java/org/redkale/source/spi/SourceModuleEngine.java +++ b/src/main/java/org/redkale/source/spi/SourceModuleEngine.java @@ -37,6 +37,7 @@ import org.redkale.source.DataMemorySource; import org.redkale.source.DataNativeSqlParser; import org.redkale.source.DataSource; import org.redkale.source.DataSources; +import org.redkale.source.DataSqlMapper; import org.redkale.source.DataSqlSource; import org.redkale.source.SearchSource; import org.redkale.source.SourceManager; @@ -136,6 +137,7 @@ public class SourceModuleEngine extends ModuleEngine implements SourceManager { //--------------------------------- 注册 DataSource、CacheSource --------------------------------- resourceFactory.register(new DataSourceLoader(), DataSource.class); resourceFactory.register(new CacheSourceLoader(), CacheSource.class); + resourceFactory.register(new DataSqlMapperBuilder(), DataSqlMapper.class); } /**