- java.lang.Object
-
- org.redkale.service.AbstractService
-
- org.redkale.source.AbstractDataSource
-
- org.redkale.source.AbstractDataSqlSource
-
- 所有已实现的接口:
AutoCloseable
,Function<Class,EntityInfo>
,Resourcable
,Service
,DataSource
,DataSqlSource
- 直接已知子类:
DataJdbcSource
@Local @AutoLoad(false) @ResourceType(DataSource.class) public abstract class AbstractDataSqlSource extends AbstractDataSource implements DataSqlSource, Function<Class,EntityInfo>
DataSource的SQL抽象实现类
注意: 所有的操作只能作用在一张表上,不能同时变更多张表详情见: https://redkale.org
- 作者:
- zhangjx
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 protected static class
AbstractDataSqlSource.PageCountSql
protected static class
AbstractDataSqlSource.PrepareInfo<T>
protected static class
AbstractDataSqlSource.UpdateSqlInfo
-
从类继承的嵌套类/接口 org.redkale.source.AbstractDataSource
AbstractDataSource.BatchAction, AbstractDataSource.DefaultDataBatch, AbstractDataSource.DeleteBatchAction1, AbstractDataSource.DeleteBatchAction2, AbstractDataSource.DeleteBatchAction3, AbstractDataSource.InsertBatchAction1, AbstractDataSource.RunnableBatchAction, AbstractDataSource.SourceUrlInfo, AbstractDataSource.UpdateBatchAction1, AbstractDataSource.UpdateBatchAction2, AbstractDataSource.UpdateBatchAction3, AbstractDataSource.UpdateBatchAction4
-
-
字段概要
字段 修饰符和类型 字段 说明 protected boolean
cacheForbidden
protected AsyncGroup
clientAsyncGroup
protected boolean
clientNonBlocking
protected AnyValue
config
protected String
containSQL
protected String
dbtype
protected BiConsumer
errorCompleteConsumer
protected static Flipper
FLIPPER_ONE
protected BiFunction<DataSource,EntityInfo,CompletableFuture<List>>
fullloader
protected Logger
logger
protected static int
MAX_RETRYS
protected DataNativeSqlParser
nativeSqlParser
protected String
notContainSQL
protected Properties
readConfProps
protected IntFunction<String>
signFunc
protected long
slowmsError
protected long
slowmsWarn
protected Map<String,String>
sortOrderbySqls
protected BiFunction<EntityInfo,Object,CharSequence>
sqlFormatter
protected DataSqlMonitor
sqlMonitor
protected String
tableCopySQL
protected String
tableNotExistSqlstates
protected ExecutorService
workExecutor
protected Properties
writeConfProps
-
从类继承的字段 org.redkale.source.AbstractDataSource
name, serialArrayFunc, sourceThreads
-
-
构造器概要
构造器 构造器 说明 AbstractDataSqlSource()
-
方法概要
所有方法 静态方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected void
afterResourceChange()
EntityInfo
apply(Class t)
boolean
autoddl()
protected <T> String
checkIllegalColumn(EntityInfo<T> info, SelectColumn selects)
<T> int
clearTable(Class<T> clazz)
清空表
等价SQL: TRUNCATE TABLE {table}<T> int
clearTable(Class<T> clazz, FilterNode node)
清空表
等价SQL: TRUNCATE TABLE {table}<T> CompletableFuture<Integer>
clearTableAsync(Class<T> clazz, FilterNode node)
清空表
等价SQL: TRUNCATE TABLE {table}protected <T> int
clearTableCache(EntityInfo<T> info, FilterNode node)
protected <T> int
clearTableDB(EntityInfo<T> info, String[] tables, FilterNode node, String... sqls)
protected abstract <T> CompletableFuture<Integer>
clearTableDBAsync(EntityInfo<T> info, String[] tables, FilterNode node, String... sqls)
protected <T> String[]
clearTableSql(EntityInfo<T> info, String[] tables, FilterNode node)
void
close()
<T> void
compile(Class<T> clazz)
提取预编译Entity类,主要用于native-image使用protected <T> void
complete(WorkThread workThread, CompletableFuture<T> future, T value)
protected String
createOrderbySql(EntityInfo info, Flipper flipper)
根据Flipper获取ORDER BY的SQL语句,不存在Flipper或sort字段返回空字符串protected <T> AbstractDataSqlSource.PageCountSql
createPageCountSql(EntityInfo<T> info, boolean readCache, boolean needTotal, boolean distinct, SelectColumn selects, String[] tables, Flipper flipper, FilterNode node)
protected <T> CharSequence
createSQLExpress(FilterNode node, EntityInfo<T> info, Map<Class,String> joinTabalis)
protected <T> CharSequence
createSQLJoin(FilterNode node, Function<Class,EntityInfo> func, boolean update, Map<Class,String> joinTabalis, Set<String> haset, EntityInfo<T> info)
<T> int
createTable(Class<T> clazz, Serializable pk)
删除表
等价SQL: DROP TABLE {table}<T> CompletableFuture<Integer>
createTableAsync(Class<T> clazz, Serializable pk)
删除表
等价SQL: DROP TABLE {table}protected <T> int
createTableDB(EntityInfo<T> info, String copyTableSql, Serializable pk, String... sqls)
protected abstract <T> CompletableFuture<Integer>
createTableDBAsync(EntityInfo<T> info, String copyTableSql, Serializable pk, String... sqls)
protected <T> String[]
createTableSqls(EntityInfo<T> info)
String
dbtype()
protected String
decryptProperty(String key, String value)
<T> int
delete(Class<T> clazz, Serializable... pks)
删除指定主键值的记录,多主键值必须在同一张表中
等价SQL: DELETE FROM {table} WHERE {primary} IN {ids}<T> int
delete(Class<T> clazz, FilterNode node)
删除符合过滤条件的记录
等价SQL: DELETE FROM {table} WHERE {filter node}<T> int
delete(Class<T> clazz, Flipper flipper, FilterNode node)
删除符合过滤条件且指定最大影响条数的记录
Flipper中offset字段将被忽略
等价SQL: DELETE FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}<T> int
delete(T... entitys)
删除对象, 必须是Entity对象<T> CompletableFuture<Integer>
deleteAsync(Class<T> clazz, Serializable... pks)
删除指定主键值的记录,多主键值必须在同一张表中
等价SQL: DELETE FROM {table} WHERE {primary} IN {ids}<T> CompletableFuture<Integer>
deleteAsync(Class<T> clazz, FilterNode node)
删除符合过滤条件的记录
等价SQL: DELETE FROM {table} WHERE {filter node}<T> CompletableFuture<Integer>
deleteAsync(Class<T> clazz, Flipper flipper, FilterNode node)
删除符合过滤条件且指定最大影响条数的记录
Flipper中offset字段将被忽略
等价SQL: DELETE FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}<T> CompletableFuture<Integer>
deleteAsync(T... entitys)
删除指定主键值的记录, 多对象必须是同一个Entity类且必须在同一张表中
等价SQL: DELETE FROM {table} WHERE {primary} IN {getValues.id}protected <T> int
deleteCache(EntityInfo<T> info, int count, Serializable... pks)
protected <T> int
deleteCache(EntityInfo<T> info, int count, Flipper flipper, FilterNode node)
protected <T> int
deleteDB(EntityInfo<T> info, String[] tables, Flipper flipper, FilterNode node, Map<String,List<Serializable>> pkmap, String... sqls)
protected abstract <T> CompletableFuture<Integer>
deleteDBAsync(EntityInfo<T> info, String[] tables, Flipper flipper, FilterNode node, Map<String,List<Serializable>> pkmap, String... sqls)
protected <T> String[]
deleteSql(EntityInfo<T> info, String[] tables, Flipper flipper, FilterNode node)
protected <T> String[]
deleteSql(EntityInfo<T> info, Map<String,List<Serializable>> pkmap)
void
destroy(AnyValue config)
进程退出时,调用Service销毁 远程模式下该方法会重载成空方法 注意: 在此方法内不能调用MessageClient.sendMessage 方法,因为Application关闭时会先destroy掉MessageClient<T> int
dropTable(Class<T> clazz, FilterNode node)
删除表
等价SQL: DROP TABLE {table}<T> CompletableFuture<Integer>
dropTableAsync(Class<T> clazz, FilterNode node)
删除表
等价SQL: DROP TABLE {table}protected <T> int
dropTableCache(EntityInfo<T> info, FilterNode node)
protected <T> int
dropTableDB(EntityInfo<T> info, String[] tables, FilterNode node, String... sqls)
protected abstract <T> CompletableFuture<Integer>
dropTableDBAsync(EntityInfo<T> info, String[] tables, FilterNode node, String... sqls)
protected <T> String[]
dropTableSql(EntityInfo<T> info, String[] tables, FilterNode node)
<T> boolean
exists(Class<T> clazz, Serializable pk)
判断是否存在主键值的记录
等价SQL: SELECT COUNT(*) FROM {table} WHERE {primary} = {id}<T> boolean
exists(Class<T> clazz, FilterNode node)
判断是否存在符合过滤条件的记录
等价SQL: SELECT COUNT(*) FROM {table} WHERE {filter node}<T> CompletableFuture<Boolean>
existsAsync(Class<T> clazz, Serializable pk)
判断是否存在主键值的记录
等价SQL: SELECT COUNT(*) FROM {table} WHERE {primary} = {id}<T> CompletableFuture<Boolean>
existsAsync(Class<T> clazz, FilterNode node)
判断是否存在符合过滤条件的记录
等价SQL: SELECT COUNT(*) FROM {table} WHERE {filter node}protected <T> boolean
existsDB(EntityInfo<T> info, String[] tables, String sql, boolean onlypk, Serializable pk, FilterNode node)
protected <T> CompletableFuture<Boolean>
existsDBApply(EntityInfo<T> info, CompletableFuture<? extends DataResultSet> future, boolean onlypk)
protected abstract <T> CompletableFuture<Boolean>
existsDBAsync(EntityInfo<T> info, String[] tables, String sql, boolean onlypk, Serializable pk, FilterNode node)
protected <T> String
existsSql(EntityInfo<T> info, Serializable pk)
protected <T> String
existsSql(EntityInfo<T> info, String[] tables, FilterNode node)
<T> T
find(Class<T> clazz, SelectColumn selects, Serializable pk)
获取指定主键值的单个记录, 返回null表示不存在值
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {primary} = {id}<T> T
find(Class<T> clazz, SelectColumn selects, FilterNode node)
获取符合过滤条件单个记录, 返回null表示不存在值
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter node}<T> CompletableFuture<T>
findAsync(Class<T> clazz, SelectColumn selects, Serializable pk)
获取指定主键值的单个记录, 返回null表示不存在值
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {primary} = {id}<T> CompletableFuture<T>
findAsync(Class<T> clazz, SelectColumn selects, FilterNode node)
获取符合过滤条件单个记录, 返回null表示不存在值
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter node}<T> Serializable
findColumn(Class<T> clazz, String column, Serializable defValue, Serializable pk)
获取符合过滤条件单个记录的单个字段值, 不存在值则返回默认值
等价SQL: SELECT {column} FROM {table} WHERE {primary} = {id}<T> Serializable
findColumn(Class<T> clazz, String column, Serializable defValue, FilterNode node)
获取符合过滤条件单个记录的单个字段值, 不存在值则返回默认值
等价SQL: SELECT {column} FROM {table} WHERE {filter node}<T> CompletableFuture<Serializable>
findColumnAsync(Class<T> clazz, String column, Serializable defValue, Serializable pk)
获取符合过滤条件单个记录的单个字段值, 不存在值则返回默认值
等价SQL: SELECT {column} FROM {table} WHERE {primary} = {id}<T> CompletableFuture<Serializable>
findColumnAsync(Class<T> clazz, String column, Serializable defValue, FilterNode node)
获取符合过滤条件单个记录的单个字段值, 不存在值则返回默认值
等价SQL: SELECT {column} FROM {table} WHERE {filter node}protected <T> Serializable
findColumnDB(EntityInfo<T> info, String[] tables, String sql, boolean onlypk, String column, Serializable defValue, Serializable pk, FilterNode node)
protected <T> CompletableFuture<Serializable>
findColumnDBApply(EntityInfo<T> info, CompletableFuture<? extends DataResultSet> future, boolean onlypk, String column, Serializable defValue)
protected abstract <T> CompletableFuture<Serializable>
findColumnDBAsync(EntityInfo<T> info, String[] tables, String sql, boolean onlypk, String column, Serializable defValue, Serializable pk, FilterNode node)
protected <T> String
findColumnSql(EntityInfo<T> info, String[] tables, String column, Serializable defValue, FilterNode node)
protected <T> String
findColumnSql(EntityInfo<T> info, String column, Serializable defValue, Serializable pk)
protected <T> T
findDB(EntityInfo<T> info, String[] tables, String sql, boolean onlypk, SelectColumn selects, Serializable pk, FilterNode node)
protected <T> CompletableFuture<T>
findDBApply(EntityInfo<T> info, CompletableFuture<? extends DataResultSet> future, boolean onlypk, SelectColumn selects)
protected abstract <T> CompletableFuture<T>
findDBAsync(EntityInfo<T> info, String[] tables, String sql, boolean onlypk, SelectColumn selects, Serializable pk, FilterNode node)
<T> T[]
finds(Class<T> clazz, SelectColumn selects, Serializable... pks)
获取指定主键值的多个记录, 返回数组,数组长度与pks一样
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {primary} = {id1,id2, ···}<T> CompletableFuture<T[]>
findsAsync(Class<T> clazz, SelectColumn selects, Serializable... pks)
获取指定主键值的多个记录, 返回数组,数组长度与pks一样
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {primary} = {id1,id2, ···}protected <T> CompletableFuture<T[]>
findsDBAsync(EntityInfo<T> info, SelectColumn selects, Serializable... pks)
<D extends Serializable,T>
List<T>findsList(Class<T> clazz, Stream<D> pks)
获取指定主键值的多个记录, 返回列表
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {primary} = {id1,id2, ···}<D extends Serializable,T>
CompletableFuture<List<T>>findsListAsync(Class<T> clazz, Stream<D> pks)
获取指定主键值的多个记录, 返回列表
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {primary} = {id1,id2, ···}protected <T> String
findSql(EntityInfo<T> info, String[] tables, SelectColumn selects, FilterNode node)
protected <T> String
findSql(EntityInfo<T> info, SelectColumn selects, Serializable pk)
protected <T> T
findUnCache(EntityInfo<T> info, SelectColumn selects, Serializable pk)
protected <T> CompletableFuture<T>
findUnCacheAsync(EntityInfo<T> info, SelectColumn selects, Serializable pk)
protected <T> CharSequence
formatValueToString(EntityInfo<T> info, Object value)
protected <T> Serializable
getEntityAttrValue(EntityInfo info, Attribute attr, T entity)
protected <T> Map<String,AbstractDataSqlSource.PrepareInfo<T>>
getInsertDollarPrepareInfo(EntityInfo<T> info, T... entitys)
protected <T> Map<String,AbstractDataSqlSource.PrepareInfo<T>>
getInsertQuestionPrepareInfo(EntityInfo<T> info, T... entitys)
<N extends Number>
Map<String,N>getNumberMap(Class entityClass, FilterNode node, FilterFuncColumn... 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}<N extends Number>
CompletableFuture<Map<String,N>>getNumberMapAsync(Class entityClass, FilterNode node, FilterFuncColumn... 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}protected <T,N extends Number>
Map<String,N>getNumberMapDB(EntityInfo<T> info, String[] tables, String sql, FilterNode node, FilterFuncColumn... columns)
protected <T,N extends Number>
CompletableFuture<Map<String,N>>getNumberMapDBApply(EntityInfo<T> info, CompletableFuture<? extends DataResultSet> future, FilterFuncColumn... columns)
protected abstract <T,N extends Number>
CompletableFuture<Map<String,N>>getNumberMapDBAsync(EntityInfo<T> info, String[] tables, String sql, FilterNode node, FilterFuncColumn... columns)
protected <T> String
getNumberMapSql(EntityInfo<T> info, String[] tables, FilterNode node, FilterFuncColumn... columns)
Number
getNumberResult(Class entityClass, FilterFunc func, Number defVal, String column, FilterNode node)
获取符合过滤条件记录的聚合结果, 无结果返回默认值
等价SQL: SELECT FUNC{column} FROM {table} WHERE {filter node}
如 getNumberResultAsync(User.class, FilterFunc.MAX, "createtime", (FilterNode)null) 等价于: SELECT MAX(createtime) FROM {table}CompletableFuture<Number>
getNumberResultAsync(Class entityClass, FilterFunc func, Number defVal, String column, FilterNode node)
获取符合过滤条件记录的聚合结果, 无结果返回默认值
等价SQL: SELECT FUNC{column} FROM {table} WHERE {filter node}
如 getNumberResultAsync(User.class, FilterFunc.MAX, "createtime", (FilterNode)null) 等价于: SELECT MAX(createtime) FROM {table}protected <T> Number
getNumberResultDB(EntityInfo<T> info, String[] tables, String sql, FilterFunc func, Number defVal, String column, FilterNode node)
protected <T> CompletableFuture<Number>
getNumberResultDBApply(EntityInfo<T> info, CompletableFuture<? extends DataResultSet> future, Number defVal, String column)
protected abstract <T> CompletableFuture<Number>
getNumberResultDBAsync(EntityInfo<T> info, String[] tables, String sql, FilterFunc func, Number defVal, String column, FilterNode node)
protected <T> String
getNumberResultSql(EntityInfo<T> info, Class entityClass, String[] tables, FilterFunc func, Number defVal, String column, FilterNode node)
IntFunction<String>
getSignFunc()
protected Serializable
getSQLAttrValue(EntityInfo info, Attribute attr, Serializable val)
protected String
getTableCopySql(EntityInfo info, String newTable)
String
getType()
获取数据源类型protected <T> Map<String,AbstractDataSqlSource.PrepareInfo<T>>
getUpdateDollarPrepareInfo(EntityInfo<T> info, T... entitys)
protected <T> Map<String,AbstractDataSqlSource.PrepareInfo<T>>
getUpdateQuestionPrepareInfo(EntityInfo<T> info, T... entitys)
void
init(AnyValue conf)
该方法必须是可以重复调用, 当reload时需要重复调用init方法 远程模式下该方法会重载成空方法protected void
initProperties(Properties props)
<T> int
insert(T... entitys)
新增对象, 必须是Entity对象<T> CompletableFuture<Integer>
insertAsync(T... entitys)
新增记录, 多对象必须是同一个Entity类且必须在同一张表中protected <T> int
insertCache(EntityInfo<T> info, T... entitys)
protected <T> int
insertDB(EntityInfo<T> info, T... entitys)
protected abstract <T> CompletableFuture<Integer>
insertDBAsync(EntityInfo<T> info, T... entitys)
protected abstract boolean
isAsync()
protected boolean
isTableNotExist(EntityInfo info, Throwable exp, String sqlCode)
<T> EntityCache<T>
loadCache(Class<T> clazz)
protected <T> EntityInfo<T>
loadEntityInfo(Class<T> clazz)
protected static StringBuilder
multiSplit(char ch1, char ch2, String split, StringBuilder sb, String str, int from)
protected DataNativeSqlStatement
nativeParse(String nativeSql, boolean countable, RowBound round, Map<String,Object> params)
<V> V
nativeQuery(String sql, BiConsumer<Object,Object> consumer, Function<DataResultSet,V> handler)
通过原生的sql查询结果<V> V
nativeQuery(String sql, BiConsumer<Object,Object> consumer, Function<DataResultSet,V> handler, Map<String,Object> params)
通过原生带参数的sql查询结果<V> Sheet<V>
nativeQuerySheet(Class<V> type, String sql, RowBound round, Map<String,Object> params)
int
nativeUpdate(String sql)
执行原生无参数的sqlint
nativeUpdate(String sql, Map<String,Object> params)
执行原生带参数的sqlint[]
nativeUpdates(String... sqls)
执行多条原生无参数的sqlvoid
onResourceChange(ResourceEvent[] events)
protected String
parseNotExistTableName(SQLException e)
protected abstract String
prepareParamSign(int index)
<T,V extends Serializable>
List<V>queryColumnList(String selectedColumn, Class<T> clazz, Flipper flipper, FilterNode node)
查询符合过滤条件记录的某个字段List集合
等价SQL: SELECT {selectedColumn} FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}<T,V extends Serializable>
CompletableFuture<List<V>>queryColumnListAsync(String selectedColumn, Class<T> clazz, Flipper flipper, FilterNode node)
查询符合过滤条件记录的某个字段List集合
等价SQL: SELECT {selectedColumn} FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}<T,K extends Serializable,N extends Number>
Map<K,N>queryColumnMap(Class<T> entityClass, String keyColumn, FilterFunc func, String funcColumn, FilterNode 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<T,K extends Serializable,N extends Number>
Map<K[],N[]>queryColumnMap(Class<T> entityClass, ColumnNode[] funcNodes, String[] groupByColumns, FilterNode 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<T,K extends Serializable,N extends Number>
Map<K,N[]>queryColumnMap(Class<T> entityClass, ColumnNode[] funcNodes, String groupByColumn, FilterNode 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<T,K extends Serializable,N extends Number>
CompletableFuture<Map<K,N>>queryColumnMapAsync(Class<T> entityClass, String keyColumn, FilterFunc func, String funcColumn, FilterNode 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<T,K extends Serializable,N extends Number>
CompletableFuture<Map<K[],N[]>>queryColumnMapAsync(Class<T> entityClass, ColumnNode[] funcNodes, String[] groupByColumns, FilterNode 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<T,K extends Serializable,N extends Number>
CompletableFuture<Map<K,N[]>>queryColumnMapAsync(Class<T> entityClass, ColumnNode[] funcNodes, String groupByColumn, FilterNode 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 targetidprotected <T,K extends Serializable,N extends Number>
Map<K,N>queryColumnMapDB(EntityInfo<T> info, String[] tables, String sql, String keyColumn, FilterFunc func, String funcColumn, FilterNode node)
protected <T,K extends Serializable,N extends Number>
Map<K[],N[]>queryColumnMapDB(EntityInfo<T> info, String[] tables, String sql, ColumnNode[] funcNodes, String[] groupByColumns, FilterNode node)
protected <T,K extends Serializable,N extends Number>
CompletableFuture<Map<K,N>>queryColumnMapDBApply(EntityInfo<T> info, CompletableFuture<? extends DataResultSet> future, String keyColumn)
protected <T,K extends Serializable,N extends Number>
CompletableFuture<Map<K[],N[]>>queryColumnMapDBApply(EntityInfo<T> info, CompletableFuture<? extends DataResultSet> future, ColumnNode[] funcNodes, String[] groupByColumns)
protected abstract <T,K extends Serializable,N extends Number>
CompletableFuture<Map<K,N>>queryColumnMapDBAsync(EntityInfo<T> info, String[] tables, String sql, String keyColumn, FilterFunc func, String funcColumn, FilterNode node)
protected abstract <T,K extends Serializable,N extends Number>
CompletableFuture<Map<K[],N[]>>queryColumnMapDBAsync(EntityInfo<T> info, String[] tables, String sql, ColumnNode[] funcNodes, String[] groupByColumns, FilterNode node)
protected <T> String
queryColumnMapSql(EntityInfo<T> info, String[] tables, String keyColumn, FilterFunc func, String funcColumn, FilterNode node)
protected <T> String
queryColumnMapSql(EntityInfo<T> info, String[] tables, ColumnNode[] funcNodes, String[] groupByColumns, FilterNode node)
<T,V extends Serializable>
Set<V>queryColumnSet(String selectedColumn, Class<T> clazz, Flipper flipper, FilterNode node)
查询符合过滤条件记录的某个字段Set集合
等价SQL: SELECT DISTINCT {selectedColumn} FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}<T,V extends Serializable>
CompletableFuture<Set<V>>queryColumnSetAsync(String selectedColumn, Class<T> clazz, Flipper flipper, FilterNode node)
查询符合过滤条件记录的某个字段Set集合
等价SQL: SELECT DISTINCT {selectedColumn} FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}<T,V extends Serializable>
Sheet<V>queryColumnSheet(String selectedColumn, Class<T> clazz, Flipper flipper, FilterNode node)
查询符合过滤条件记录的某个字段Sheet集合
等价SQL: SELECT {selectedColumn} FROM {table} WHERE {filter bean} ORDER BY {flipper.sort} LIMIT {flipper.limit}<T,V extends Serializable>
CompletableFuture<Sheet<V>>queryColumnSheetAsync(String selectedColumn, Class<T> clazz, Flipper flipper, FilterNode node)
查询符合过滤条件记录的某个字段Sheet集合
等价SQL: SELECT {selectedColumn} FROM {table} WHERE {filter bean} ORDER BY {flipper.sort} LIMIT {flipper.limit}<T> List<T>
queryList(Class<T> clazz, SelectColumn selects, Flipper flipper, FilterNode node)
查询符合过滤条件记录的List集合
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}<T> CompletableFuture<List<T>>
queryListAsync(Class<T> clazz, SelectColumn selects, Flipper flipper, FilterNode node)
查询符合过滤条件记录的List集合
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}<K extends Serializable,T>
Map<K,T>queryMap(Class<T> clazz, SelectColumn selects, Stream<K> keyStream)
查询符合过滤条件记录的Map集合, 主键值为key
等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit}<K extends Serializable,T>
Map<K,T>queryMap(Class<T> clazz, SelectColumn selects, FilterNode node)
查询符合过滤条件记录的Map集合, 主键值为key
等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit}<K extends Serializable,T>
CompletableFuture<Map<K,T>>queryMapAsync(Class<T> clazz, SelectColumn selects, Stream<K> keyStream)
查询符合过滤条件记录的List转Map集合, key=主键值, value=Entity对象
等价SQL: SELECT * FROM {table} WHERE id IN {ids}<K extends Serializable,T>
CompletableFuture<Map<K,T>>queryMapAsync(Class<T> clazz, SelectColumn selects, FilterNode node)
查询符合过滤条件记录的List转Map集合, key=主键值, value=Entity对象
等价SQL: SELECT * FROM {table} WHERE {filter node}<T> Set<T>
querySet(Class<T> clazz, SelectColumn selects, Flipper flipper, FilterNode node)
查询符合过滤条件记录的Set集合
等价SQL: SELECT DISTINCT {column1},{column2}, ··· FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}<T> CompletableFuture<Set<T>>
querySetAsync(Class<T> clazz, SelectColumn selects, Flipper flipper, FilterNode node)
查询符合过滤条件记录的Set集合
等价SQL: SELECT DISTINCT {column1},{column2}, ··· FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}protected <T> Sheet<T>
querySheet(boolean readCache, boolean needTotal, boolean distinct, Class<T> clazz, SelectColumn selects, Flipper flipper, FilterNode node)
<T> Sheet<T>
querySheet(Class<T> clazz, SelectColumn selects, Flipper flipper, FilterNode node)
查询符合过滤条件记录的Sheet集合
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}protected <T> CompletableFuture<Sheet<T>>
querySheetAsync(boolean readCache, boolean needTotal, boolean distinct, Class<T> clazz, SelectColumn selects, Flipper flipper, FilterNode node)
<T> CompletableFuture<Sheet<T>>
querySheetAsync(Class<T> clazz, SelectColumn selects, Flipper flipper, FilterNode node)
查询符合过滤条件记录的Sheet集合
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}protected <T> Sheet<T>
querySheetDB(EntityInfo<T> info, boolean readcache, boolean needtotal, boolean distinct, SelectColumn selects, Flipper flipper, FilterNode node)
protected abstract <T> CompletableFuture<Sheet<T>>
querySheetDBAsync(EntityInfo<T> info, boolean readcache, boolean needtotal, boolean distinct, SelectColumn selects, Flipper flipper, FilterNode node, boolean inCacheLoad)
protected abstract int
readMaxConns()
<T> void
refreshCache(Class<T> clazz)
将entity的对象全部加载到Cache中去,如果clazz没有被@org.redkale.persistence.Cacheable注解则不做任何事<T> int
reloadCache(Class<T> clazz, Serializable... pks)
protected void
slowLog(long startTime, String... sqls)
String
toString()
<T> int
update(T... entitys)
更新对象, 必须是Entity对象<T> CompletableFuture<Integer>
updateAsync(T... entitys)
更新记录, 多对象必须是同一个Entity类且必须在同一张表中
等价SQL:
UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id1}
UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id2}
···protected <T> int
updateCache(EntityInfo<T> info, int count, boolean needNode, T entity, FilterNode node, SelectColumn selects)
protected <T> int
updateCache(EntityInfo<T> info, int count, Serializable pk, String column, Serializable colval)
protected <T> int
updateCache(EntityInfo<T> info, int count, Serializable pk, ColumnValue... values)
protected <T> int
updateCache(EntityInfo<T> info, int count, String column, Serializable colval, FilterNode node)
protected <T> int
updateCache(EntityInfo<T> info, int count, FilterNode node, Flipper flipper, ColumnValue... values)
protected <T> int
updateCache(EntityInfo<T> info, int count, T... entitys)
<T> int
updateColumn(Class<T> clazz, Serializable pk, String column, Serializable colval)
根据主键值更新对象的column对应的值, 必须是Entity Class<T> int
updateColumn(Class<T> clazz, Serializable pk, ColumnValue... values)
根据主键值更新对象的多个column对应的值, 必须是Entity Class<T> int
updateColumn(Class<T> clazz, String column, Serializable colval, FilterNode node)
根据主键值更新对象的column对应的值, 必须是Entity Class<T> int
updateColumn(Class<T> clazz, FilterNode node, Flipper flipper, ColumnValue... values)
更新符合过滤条件的记录的指定字段
Flipper中offset字段将被忽略
注意:Entity类中标记为@Column(updatable=false)不会被更新
等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} += {value2}, {column3} *= {value3}, ··· WHERE {filter node} ORDER BY {flipper.sort}<T> int
updateColumn(T entity, FilterNode node, SelectColumn selects)
更新符合过滤条件记录的指定字段
注意:Entity类中标记为@Column(updatable=false)不会被更新
等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {filter node}<T> int
updateColumn(T entity, SelectColumn selects)
更新单个记录的指定字段
注意:Entity类中标记为@Column(updatable=false)不会被更新
等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {primary} = {bean.id}<T> CompletableFuture<Integer>
updateColumnAsync(Class<T> clazz, Serializable pk, String column, Serializable colval)
更新单个记录的单个字段
注意:即使字段标记为@Column(updatable=false)也会被更新
等价SQL: UPDATE {table} SET {column} = {value} WHERE {primary} = {id}<T> CompletableFuture<Integer>
updateColumnAsync(Class<T> clazz, Serializable pk, ColumnValue... values)
更新指定主键值记录的部分字段
字段赋值操作选项见 ColumnExpress
等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} += {value2}, {column3} *= {value3}, ··· WHERE {filter node}<T> CompletableFuture<Integer>
updateColumnAsync(Class<T> clazz, String column, Serializable colval, FilterNode node)
更新符合过滤条件记录的单个字段
注意:即使字段标记为@Column(updatable=false)也会被更新
等价SQL: UPDATE {table} SET {column} = {value} WHERE {filter node}<T> CompletableFuture<Integer>
updateColumnAsync(Class<T> clazz, FilterNode node, Flipper flipper, ColumnValue... values)
更新符合过滤条件的记录的指定字段
Flipper中offset字段将被忽略
注意:Entity类中标记为@Column(updatable=false)不会被更新
等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} += {value2}, {column3} *= {value3}, ··· WHERE {filter node} ORDER BY {flipper.sort}<T> CompletableFuture<Integer>
updateColumnAsync(T entity, FilterNode node, SelectColumn selects)
更新符合过滤条件记录的指定字段
注意:Entity类中标记为@Column(updatable=false)不会被更新
等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {filter node}<T> CompletableFuture<Integer>
updateColumnAsync(T entity, SelectColumn selects)
更新单个记录的指定字段
注意:Entity类中标记为@Column(updatable=false)不会被更新
等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {primary} = {bean.id}protected <T> int
updateColumnDB(EntityInfo<T> info, Flipper flipper, AbstractDataSqlSource.UpdateSqlInfo sql)
protected abstract <T> CompletableFuture<Integer>
updateColumnDBAsync(EntityInfo<T> info, Flipper flipper, AbstractDataSqlSource.UpdateSqlInfo sql)
protected <T> AbstractDataSqlSource.UpdateSqlInfo
updateColumnSql(EntityInfo<T> info, boolean needNode, T entity, FilterNode node, SelectColumn selects)
protected <T> AbstractDataSqlSource.UpdateSqlInfo
updateColumnSql(EntityInfo<T> info, Serializable pk, String column, Serializable colval)
protected <T> AbstractDataSqlSource.UpdateSqlInfo
updateColumnSql(EntityInfo<T> info, Serializable pk, ColumnValue... values)
protected <T> AbstractDataSqlSource.UpdateSqlInfo
updateColumnSql(EntityInfo<T> info, String column, Serializable colval, FilterNode node)
protected <T> AbstractDataSqlSource.UpdateSqlInfo
updateColumnSql(EntityInfo<T> info, FilterNode node, Flipper flipper, ColumnValue... values)
protected <T> int
updateEntityDB(EntityInfo<T> info, T... entitys)
protected abstract <T> CompletableFuture<Integer>
updateEntityDBAsync(EntityInfo<T> info, T... entitys)
protected void
updateOneResourceChange(Properties newProps, ResourceEvent[] events)
protected void
updateReadResourceChange(Properties newReadProps, ResourceEvent[] events)
protected void
updateWriteResourceChange(Properties newWriteProps, ResourceEvent[] events)
protected abstract int
writeMaxConns()
-
从类继承的方法 org.redkale.source.AbstractDataSource
batch, batchAsync, checkEntity, clearTableAsync, completeExceptionally, createPredicate, dropTable, dropTableAsync, executorToString, exists, existsAsync, find, find, find, find, find, findAsync, findAsync, findAsync, findAsync, findAsync, findColumn, findColumn, findColumn, findColumn, findColumnAsync, findColumnAsync, findColumnAsync, findColumnAsync, getEntityInfo, getEntityValue, getExecutor, getJoinTabalis, getNumberMap, getNumberMap, getNumberMapAsync, getNumberMapAsync, getNumberResult, getNumberResult, getNumberResult, getNumberResult, getNumberResult, getNumberResultAsync, getNumberResultAsync, getNumberResultAsync, getNumberResultAsync, getNumberResultAsync, insert, insert, insertAsync, insertAsync, isCacheUseable, isOnlyCache, loadEntityInfo, parseSourceUrl, queryColumnList, queryColumnList, queryColumnList, queryColumnList, queryColumnListAsync, queryColumnListAsync, queryColumnListAsync, queryColumnListAsync, queryColumnMap, queryColumnMap, queryColumnMap, queryColumnMap, queryColumnMap, queryColumnMap, queryColumnMapAsync, queryColumnMapAsync, queryColumnMapAsync, queryColumnMapAsync, queryColumnMapAsync, queryColumnMapAsync, queryColumnSet, queryColumnSet, queryColumnSet, queryColumnSet, queryColumnSetAsync, queryColumnSetAsync, queryColumnSetAsync, queryColumnSetAsync, queryColumnSheet, queryColumnSheetAsync, queryList, queryList, queryList, queryList, queryList, queryList, queryList, queryList, queryList, queryList, queryListAsync, queryListAsync, queryListAsync, queryListAsync, queryListAsync, queryListAsync, queryListAsync, queryListAsync, queryListAsync, queryListAsync, queryMap, queryMap, queryMap, queryMap, queryMapAsync, queryMapAsync, queryMapAsync, queryMapAsync, querySet, querySet, querySet, querySet, querySet, querySet, querySet, querySet, querySet, querySet, querySetAsync, querySetAsync, querySetAsync, querySetAsync, querySetAsync, querySetAsync, querySetAsync, querySetAsync, querySetAsync, querySetAsync, querySheet, querySheet, querySheet, querySheetAsync, querySheetAsync, querySheetAsync, resourceName, setSourceExecutor, supplyAsync, updateColumn, updateColumn, updateColumn, updateColumnAsync, updateColumnAsync, updateColumnAsync
-
从类继承的方法 org.redkale.service.AbstractService
runAsync, serviceName, serviceType
-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
从接口继承的方法 org.redkale.source.DataSource
batch, batchAsync, clearTableAsync, delete, delete, deleteAsync, deleteAsync, dropTable, dropTableAsync, exists, existsAsync, find, find, find, find, find, find, findAsync, findAsync, findAsync, findAsync, findAsync, findAsync, findColumn, findColumn, findColumn, findColumn, findColumnAsync, findColumnAsync, findColumnAsync, findColumnAsync, finds, finds, finds, findsAsync, findsAsync, findsAsync, getNumberMap, getNumberMap, getNumberMapAsync, getNumberMapAsync, getNumberResult, getNumberResult, getNumberResult, getNumberResult, getNumberResult, getNumberResultAsync, getNumberResultAsync, getNumberResultAsync, getNumberResultAsync, getNumberResultAsync, insert, insert, insertAsync, insertAsync, queryColumnList, queryColumnList, queryColumnList, queryColumnList, queryColumnListAsync, queryColumnListAsync, queryColumnListAsync, queryColumnListAsync, queryColumnMap, queryColumnMap, queryColumnMap, queryColumnMap, queryColumnMap, queryColumnMap, queryColumnMapAsync, queryColumnMapAsync, queryColumnMapAsync, queryColumnMapAsync, queryColumnMapAsync, queryColumnMapAsync, queryColumnSet, queryColumnSet, queryColumnSet, queryColumnSet, queryColumnSetAsync, queryColumnSetAsync, queryColumnSetAsync, queryColumnSetAsync, queryColumnSheet, queryColumnSheet, queryColumnSheetAsync, queryColumnSheetAsync, queryList, queryList, queryList, queryList, queryList, queryList, queryList, queryList, queryList, queryList, queryList, queryList, queryListAsync, queryListAsync, queryListAsync, queryListAsync, queryListAsync, queryListAsync, queryListAsync, queryListAsync, queryListAsync, queryListAsync, queryListAsync, queryListAsync, queryMap, queryMap, queryMap, queryMap, queryMapAsync, queryMapAsync, queryMapAsync, queryMapAsync, querySet, querySet, querySet, querySet, querySet, querySet, querySet, querySet, querySet, querySet, querySetAsync, querySetAsync, querySetAsync, querySetAsync, querySetAsync, querySetAsync, querySetAsync, querySetAsync, querySetAsync, querySetAsync, querySheet, querySheet, querySheet, querySheet, querySheet, querySheetAsync, querySheetAsync, querySheetAsync, querySheetAsync, querySheetAsync, update, update, updateAsync, updateAsync, updateColumn, updateColumn, updateColumn, updateColumn, updateColumn, updateColumn, updateColumn, updateColumn, updateColumn, updateColumn, updateColumn, updateColumnAsync, updateColumnAsync, updateColumnAsync, updateColumnAsync, updateColumnAsync, updateColumnAsync, updateColumnAsync, updateColumnAsync, updateColumnAsync, updateColumnAsync, updateColumnAsync
-
从接口继承的方法 org.redkale.source.DataSqlSource
nativeQuery, nativeQuery, nativeQuery, nativeQueryAsync, nativeQueryAsync, nativeQueryAsync, nativeQueryAsync, nativeQueryAsync, nativeQueryList, nativeQueryList, nativeQueryList, nativeQueryListAsync, nativeQueryListAsync, nativeQueryListAsync, nativeQueryMap, nativeQueryMap, nativeQueryMap, nativeQueryMapAsync, nativeQueryMapAsync, nativeQueryMapAsync, nativeQueryOne, nativeQueryOne, nativeQueryOne, nativeQueryOneAsync, nativeQueryOneAsync, nativeQueryOneAsync, nativeQuerySheet, nativeQuerySheet, nativeQuerySheet, nativeQuerySheetAsync, nativeQuerySheetAsync, nativeQuerySheetAsync, nativeQuerySheetAsync, nativeQueryStrStrMapAsync, nativeQueryToIntStrMap, nativeQueryToIntStrMap, nativeQueryToIntStrMap, nativeQueryToIntStrMapAsync, nativeQueryToIntStrMapAsync, nativeQueryToIntStrMapAsync, nativeQueryToStrStrMap, nativeQueryToStrStrMap, nativeQueryToStrStrMap, nativeQueryToStrStrMapAsync, nativeQueryToStrStrMapAsync, nativeUpdate, nativeUpdateAsync, nativeUpdateAsync, nativeUpdateAsync, nativeUpdatesAsync
-
从接口继承的方法 org.redkale.inject.Resourcable
resourceName
-
-
-
-
字段详细资料
-
MAX_RETRYS
protected static final int MAX_RETRYS
- 另请参阅:
- 常量字段值
-
FLIPPER_ONE
protected static final Flipper FLIPPER_ONE
-
logger
protected final Logger logger
-
cacheForbidden
protected boolean cacheForbidden
-
dbtype
protected String dbtype
-
readConfProps
protected Properties readConfProps
-
writeConfProps
protected Properties writeConfProps
-
clientAsyncGroup
protected AsyncGroup clientAsyncGroup
-
workExecutor
protected ExecutorService workExecutor
-
nativeSqlParser
protected DataNativeSqlParser nativeSqlParser
-
sqlMonitor
protected DataSqlMonitor sqlMonitor
-
sqlFormatter
protected BiFunction<EntityInfo,Object,CharSequence> sqlFormatter
-
errorCompleteConsumer
protected BiConsumer errorCompleteConsumer
-
fullloader
protected final BiFunction<DataSource,EntityInfo,CompletableFuture<List>> fullloader
-
signFunc
protected final IntFunction<String> signFunc
-
slowmsWarn
protected long slowmsWarn
-
slowmsError
protected long slowmsError
-
clientNonBlocking
protected boolean clientNonBlocking
-
containSQL
protected String containSQL
-
notContainSQL
protected String notContainSQL
-
tableNotExistSqlstates
protected String tableNotExistSqlstates
-
tableCopySQL
protected String tableCopySQL
-
config
protected AnyValue config
-
-
方法详细资料
-
init
public void init(AnyValue conf)
从接口复制的说明:Service
该方法必须是可以重复调用, 当reload时需要重复调用init方法 远程模式下该方法会重载成空方法- 指定者:
init
在接口中Service
- 覆盖:
init
在类中AbstractDataSource
- 参数:
conf
- 配置参数
-
afterResourceChange
protected void afterResourceChange()
-
createPageCountSql
protected <T> AbstractDataSqlSource.PageCountSql createPageCountSql(EntityInfo<T> info, boolean readCache, boolean needTotal, boolean distinct, SelectColumn selects, String[] tables, Flipper flipper, FilterNode node)
-
createOrderbySql
protected String createOrderbySql(EntityInfo info, Flipper flipper)
根据Flipper获取ORDER BY的SQL语句,不存在Flipper或sort字段返回空字符串- 参数:
info
- EntityInfoflipper
- 翻页对象- 返回:
- String
-
onResourceChange
@ResourceChanged public void onResourceChange(ResourceEvent[] events)
- 指定者:
onResourceChange
在类中AbstractDataSource
-
complete
protected <T> void complete(WorkThread workThread, CompletableFuture<T> future, T value)
- 覆盖:
complete
在类中AbstractDataSource
-
updateOneResourceChange
protected void updateOneResourceChange(Properties newProps, ResourceEvent[] events)
-
updateReadResourceChange
protected void updateReadResourceChange(Properties newReadProps, ResourceEvent[] events)
-
updateWriteResourceChange
protected void updateWriteResourceChange(Properties newWriteProps, ResourceEvent[] events)
-
slowLog
protected void slowLog(long startTime, String... sqls)
-
parseNotExistTableName
protected String parseNotExistTableName(SQLException e)
-
initProperties
protected void initProperties(Properties props)
-
readMaxConns
protected abstract int readMaxConns()
-
writeMaxConns
protected abstract int writeMaxConns()
-
createTableSqls
protected <T> String[] createTableSqls(EntityInfo<T> info)
-
isTableNotExist
protected boolean isTableNotExist(EntityInfo info, Throwable exp, String sqlCode)
-
getTableCopySql
protected String getTableCopySql(EntityInfo info, String newTable)
-
getSQLAttrValue
protected Serializable getSQLAttrValue(EntityInfo info, Attribute attr, Serializable val)
-
getInsertQuestionPrepareInfo
protected <T> Map<String,AbstractDataSqlSource.PrepareInfo<T>> getInsertQuestionPrepareInfo(EntityInfo<T> info, T... entitys)
-
getInsertDollarPrepareInfo
protected <T> Map<String,AbstractDataSqlSource.PrepareInfo<T>> getInsertDollarPrepareInfo(EntityInfo<T> info, T... entitys)
-
getUpdateQuestionPrepareInfo
protected <T> Map<String,AbstractDataSqlSource.PrepareInfo<T>> getUpdateQuestionPrepareInfo(EntityInfo<T> info, T... entitys)
-
getUpdateDollarPrepareInfo
protected <T> Map<String,AbstractDataSqlSource.PrepareInfo<T>> getUpdateDollarPrepareInfo(EntityInfo<T> info, T... entitys)
-
getEntityAttrValue
protected <T> Serializable getEntityAttrValue(EntityInfo info, Attribute attr, T entity)
-
nativeParse
protected DataNativeSqlStatement nativeParse(String nativeSql, boolean countable, RowBound round, Map<String,Object> params)
-
getSignFunc
public IntFunction<String> getSignFunc()
-
destroy
public void destroy(AnyValue config)
从接口复制的说明:Service
进程退出时,调用Service销毁 远程模式下该方法会重载成空方法 注意: 在此方法内不能调用MessageClient.sendMessage 方法,因为Application关闭时会先destroy掉MessageClient
-
compile
public <T> void compile(Class<T> clazz)
从接口复制的说明:DataSource
提取预编译Entity类,主要用于native-image使用- 指定者:
compile
在接口中DataSource
- 类型参数:
T
- 泛型- 参数:
clazz
- Entity实体类
-
dbtype
public final String dbtype()
-
autoddl
public final boolean autoddl()
-
isAsync
protected abstract boolean isAsync()
-
prepareParamSign
protected abstract String prepareParamSign(int index)
-
insertDBAsync
protected abstract <T> CompletableFuture<Integer> insertDBAsync(EntityInfo<T> info, T... entitys)
-
deleteDBAsync
protected abstract <T> CompletableFuture<Integer> deleteDBAsync(EntityInfo<T> info, String[] tables, Flipper flipper, FilterNode node, Map<String,List<Serializable>> pkmap, String... sqls)
-
clearTableDBAsync
protected abstract <T> CompletableFuture<Integer> clearTableDBAsync(EntityInfo<T> info, String[] tables, FilterNode node, String... sqls)
-
createTableDBAsync
protected abstract <T> CompletableFuture<Integer> createTableDBAsync(EntityInfo<T> info, String copyTableSql, Serializable pk, String... sqls)
-
dropTableDBAsync
protected abstract <T> CompletableFuture<Integer> dropTableDBAsync(EntityInfo<T> info, String[] tables, FilterNode node, String... sqls)
-
updateEntityDBAsync
protected abstract <T> CompletableFuture<Integer> updateEntityDBAsync(EntityInfo<T> info, T... entitys)
-
updateColumnDBAsync
protected abstract <T> CompletableFuture<Integer> updateColumnDBAsync(EntityInfo<T> info, Flipper flipper, AbstractDataSqlSource.UpdateSqlInfo sql)
-
getNumberMapDBAsync
protected abstract <T,N extends Number> CompletableFuture<Map<String,N>> getNumberMapDBAsync(EntityInfo<T> info, String[] tables, String sql, FilterNode node, FilterFuncColumn... columns)
-
getNumberResultDBAsync
protected abstract <T> CompletableFuture<Number> getNumberResultDBAsync(EntityInfo<T> info, String[] tables, String sql, FilterFunc func, Number defVal, String column, FilterNode node)
-
queryColumnMapDBAsync
protected abstract <T,K extends Serializable,N extends Number> CompletableFuture<Map<K,N>> queryColumnMapDBAsync(EntityInfo<T> info, String[] tables, String sql, String keyColumn, FilterFunc func, String funcColumn, FilterNode node)
-
queryColumnMapDBAsync
protected abstract <T,K extends Serializable,N extends Number> CompletableFuture<Map<K[],N[]>> queryColumnMapDBAsync(EntityInfo<T> info, String[] tables, String sql, ColumnNode[] funcNodes, String[] groupByColumns, FilterNode node)
-
findDBAsync
protected abstract <T> CompletableFuture<T> findDBAsync(EntityInfo<T> info, String[] tables, String sql, boolean onlypk, SelectColumn selects, Serializable pk, FilterNode node)
-
findColumnDBAsync
protected abstract <T> CompletableFuture<Serializable> findColumnDBAsync(EntityInfo<T> info, String[] tables, String sql, boolean onlypk, String column, Serializable defValue, Serializable pk, FilterNode node)
-
existsDBAsync
protected abstract <T> CompletableFuture<Boolean> existsDBAsync(EntityInfo<T> info, String[] tables, String sql, boolean onlypk, Serializable pk, FilterNode node)
-
querySheetDBAsync
protected abstract <T> CompletableFuture<Sheet<T>> querySheetDBAsync(EntityInfo<T> info, boolean readcache, boolean needtotal, boolean distinct, SelectColumn selects, Flipper flipper, FilterNode node, boolean inCacheLoad)
-
insertDB
protected <T> int insertDB(EntityInfo<T> info, T... entitys)
-
deleteDB
protected <T> int deleteDB(EntityInfo<T> info, String[] tables, Flipper flipper, FilterNode node, Map<String,List<Serializable>> pkmap, String... sqls)
-
clearTableDB
protected <T> int clearTableDB(EntityInfo<T> info, String[] tables, FilterNode node, String... sqls)
-
createTableDB
protected <T> int createTableDB(EntityInfo<T> info, String copyTableSql, Serializable pk, String... sqls)
-
dropTableDB
protected <T> int dropTableDB(EntityInfo<T> info, String[] tables, FilterNode node, String... sqls)
-
updateEntityDB
protected <T> int updateEntityDB(EntityInfo<T> info, T... entitys)
-
updateColumnDB
protected <T> int updateColumnDB(EntityInfo<T> info, Flipper flipper, AbstractDataSqlSource.UpdateSqlInfo sql)
-
getNumberMapDB
protected <T,N extends Number> Map<String,N> getNumberMapDB(EntityInfo<T> info, String[] tables, String sql, FilterNode node, FilterFuncColumn... columns)
-
getNumberResultDB
protected <T> Number getNumberResultDB(EntityInfo<T> info, String[] tables, String sql, FilterFunc func, Number defVal, String column, FilterNode node)
-
queryColumnMapDB
protected <T,K extends Serializable,N extends Number> Map<K,N> queryColumnMapDB(EntityInfo<T> info, String[] tables, String sql, String keyColumn, FilterFunc func, String funcColumn, FilterNode node)
-
queryColumnMapDB
protected <T,K extends Serializable,N extends Number> Map<K[],N[]> queryColumnMapDB(EntityInfo<T> info, String[] tables, String sql, ColumnNode[] funcNodes, String[] groupByColumns, FilterNode node)
-
findDB
protected <T> T findDB(EntityInfo<T> info, String[] tables, String sql, boolean onlypk, SelectColumn selects, Serializable pk, FilterNode node)
-
findColumnDB
protected <T> Serializable findColumnDB(EntityInfo<T> info, String[] tables, String sql, boolean onlypk, String column, Serializable defValue, Serializable pk, FilterNode node)
-
existsDB
protected <T> boolean existsDB(EntityInfo<T> info, String[] tables, String sql, boolean onlypk, Serializable pk, FilterNode node)
-
querySheetDB
protected <T> Sheet<T> querySheetDB(EntityInfo<T> info, boolean readcache, boolean needtotal, boolean distinct, SelectColumn selects, Flipper flipper, FilterNode node)
-
createSQLJoin
protected <T> CharSequence createSQLJoin(FilterNode node, Function<Class,EntityInfo> func, boolean update, Map<Class,String> joinTabalis, Set<String> haset, EntityInfo<T> info)
-
createSQLExpress
protected <T> CharSequence createSQLExpress(FilterNode node, EntityInfo<T> info, Map<Class,String> joinTabalis)
-
getType
public String getType()
从接口复制的说明:DataSource
获取数据源类型- 指定者:
getType
在接口中DataSource
- 返回:
- String
-
apply
public EntityInfo apply(Class t)
- 指定者:
apply
在接口中Function<Class,EntityInfo>
-
close
public void close() throws Exception
- 指定者:
close
在接口中AutoCloseable
- 抛出:
Exception
-
loadEntityInfo
protected <T> EntityInfo<T> loadEntityInfo(Class<T> clazz)
-
loadCache
public <T> EntityCache<T> loadCache(Class<T> clazz)
-
refreshCache
public <T> void refreshCache(Class<T> clazz)
将entity的对象全部加载到Cache中去,如果clazz没有被@org.redkale.persistence.Cacheable注解则不做任何事- 类型参数:
T
- Entity类泛型- 参数:
clazz
- Entity类
-
formatValueToString
protected <T> CharSequence formatValueToString(EntityInfo<T> info, Object value)
-
insert
public <T> int insert(T... entitys)
新增对象, 必须是Entity对象- 指定者:
insert
在接口中DataSource
- 类型参数:
T
- Entity类泛型- 参数:
entitys
- Entity对象- 返回:
- 影响的记录条数
-
insertAsync
public <T> CompletableFuture<Integer> insertAsync(T... entitys)
从接口复制的说明:DataSource
新增记录, 多对象必须是同一个Entity类且必须在同一张表中- 指定者:
insertAsync
在接口中DataSource
- 类型参数:
T
- 泛型- 参数:
entitys
- Entity对象- 返回:
- CompletableFuture
-
insertCache
protected <T> int insertCache(EntityInfo<T> info, T... entitys)
-
delete
public <T> int delete(T... entitys)
删除对象, 必须是Entity对象- 指定者:
delete
在接口中DataSource
- 类型参数:
T
- Entity类泛型- 参数:
entitys
- Entity对象- 返回:
- 删除的数据条数
-
deleteAsync
public <T> CompletableFuture<Integer> deleteAsync(T... entitys)
从接口复制的说明:DataSource
删除指定主键值的记录, 多对象必须是同一个Entity类且必须在同一张表中
等价SQL: DELETE FROM {table} WHERE {primary} IN {getValues.id}- 指定者:
deleteAsync
在接口中DataSource
- 类型参数:
T
- 泛型- 参数:
entitys
- Entity对象- 返回:
- 影响的记录条数CompletableFuture
-
delete
public <T> int delete(Class<T> clazz, Serializable... pks)
从接口复制的说明:DataSource
删除指定主键值的记录,多主键值必须在同一张表中
等价SQL: DELETE FROM {table} WHERE {primary} IN {ids}- 指定者:
delete
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类pks
- 主键值- 返回:
- 影响的记录条数
-
deleteAsync
public <T> CompletableFuture<Integer> deleteAsync(Class<T> clazz, Serializable... pks)
从接口复制的说明:DataSource
删除指定主键值的记录,多主键值必须在同一张表中
等价SQL: DELETE FROM {table} WHERE {primary} IN {ids}- 指定者:
deleteAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类pks
- 主键值- 返回:
- 影响的记录条数CompletableFuture
-
delete
public <T> int delete(Class<T> clazz, FilterNode node)
从接口复制的说明:DataSource
删除符合过滤条件的记录
等价SQL: DELETE FROM {table} WHERE {filter node}- 指定者:
delete
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类node
- 过滤条件- 返回:
- 影响的记录条数
-
deleteAsync
public <T> CompletableFuture<Integer> deleteAsync(Class<T> clazz, FilterNode node)
从接口复制的说明:DataSource
删除符合过滤条件的记录
等价SQL: DELETE FROM {table} WHERE {filter node}- 指定者:
deleteAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类node
- 过滤条件- 返回:
- 影响的记录条数CompletableFuture
-
delete
public <T> int delete(Class<T> clazz, Flipper flipper, FilterNode node)
从接口复制的说明:DataSource
删除符合过滤条件且指定最大影响条数的记录
Flipper中offset字段将被忽略
等价SQL: DELETE FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}- 指定者:
delete
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类flipper
- 翻页对象node
- 过滤条件- 返回:
- 影响的记录条数
-
deleteAsync
public <T> CompletableFuture<Integer> deleteAsync(Class<T> clazz, Flipper flipper, FilterNode node)
从接口复制的说明:DataSource
删除符合过滤条件且指定最大影响条数的记录
Flipper中offset字段将被忽略
等价SQL: DELETE FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}- 指定者:
deleteAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类flipper
- 翻页对象node
- 过滤条件- 返回:
- 影响的记录条数CompletableFuture
-
deleteSql
protected <T> String[] deleteSql(EntityInfo<T> info, Map<String,List<Serializable>> pkmap)
-
deleteSql
protected <T> String[] deleteSql(EntityInfo<T> info, String[] tables, Flipper flipper, FilterNode node)
-
clearTable
public <T> int clearTable(Class<T> clazz)
从接口复制的说明:DataSource
清空表
等价SQL: TRUNCATE TABLE {table}- 指定者:
clearTable
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类- 返回:
- 影响的记录条数 -1表示表不存在
-
clearTable
public <T> int clearTable(Class<T> clazz, FilterNode node)
从接口复制的说明:DataSource
清空表
等价SQL: TRUNCATE TABLE {table}- 指定者:
clearTable
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类node
- 分库分表的过滤条件- 返回:
- 影响的记录条数 -1表示表不存在
-
clearTableAsync
public <T> CompletableFuture<Integer> clearTableAsync(Class<T> clazz, FilterNode node)
从接口复制的说明:DataSource
清空表
等价SQL: TRUNCATE TABLE {table}- 指定者:
clearTableAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类node
- 分库分表的过滤条件- 返回:
- 影响的记录条数CompletableFuture -1表示表不存在
-
clearTableSql
protected <T> String[] clearTableSql(EntityInfo<T> info, String[] tables, FilterNode node)
-
createTable
public <T> int createTable(Class<T> clazz, Serializable pk)
从接口复制的说明:DataSource
删除表
等价SQL: DROP TABLE {table}- 指定者:
createTable
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类pk
- 主键- 返回:
- 建表结果
-
createTableAsync
public <T> CompletableFuture<Integer> createTableAsync(Class<T> clazz, Serializable pk)
从接口复制的说明:DataSource
删除表
等价SQL: DROP TABLE {table}- 指定者:
createTableAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类pk
- 主键- 返回:
- 建表结果
-
dropTable
public <T> int dropTable(Class<T> clazz, FilterNode node)
从接口复制的说明:DataSource
删除表
等价SQL: DROP TABLE {table}- 指定者:
dropTable
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类node
- 过滤条件- 返回:
- 影响的记录条数 -1表示表不存在
-
dropTableAsync
public <T> CompletableFuture<Integer> dropTableAsync(Class<T> clazz, FilterNode node)
从接口复制的说明:DataSource
删除表
等价SQL: DROP TABLE {table}- 指定者:
dropTableAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类node
- 分库分表的过滤条件- 返回:
- 影响的记录条数CompletableFuture -1表示表不存在
-
dropTableSql
protected <T> String[] dropTableSql(EntityInfo<T> info, String[] tables, FilterNode node)
-
clearTableCache
protected <T> int clearTableCache(EntityInfo<T> info, FilterNode node)
-
dropTableCache
protected <T> int dropTableCache(EntityInfo<T> info, FilterNode node)
-
deleteCache
protected <T> int deleteCache(EntityInfo<T> info, int count, Flipper flipper, FilterNode node)
-
deleteCache
protected <T> int deleteCache(EntityInfo<T> info, int count, Serializable... pks)
-
multiSplit
protected static StringBuilder multiSplit(char ch1, char ch2, String split, StringBuilder sb, String str, int from)
-
update
public <T> int update(T... entitys)
更新对象, 必须是Entity对象- 指定者:
update
在接口中DataSource
- 类型参数:
T
- Entity类泛型- 参数:
entitys
- Entity对象- 返回:
- 更新的数据条数
-
updateAsync
public <T> CompletableFuture<Integer> updateAsync(T... entitys)
从接口复制的说明:DataSource
更新记录, 多对象必须是同一个Entity类且必须在同一张表中
等价SQL:
UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id1}
UPDATE {table} SET column1 = value1, column2 = value2, ··· WHERE {primary} = {id2}
···- 指定者:
updateAsync
在接口中DataSource
- 类型参数:
T
- 泛型- 参数:
entitys
- Entity对象- 返回:
- 影响的记录条数CompletableFuture
-
updateColumn
public <T> int updateColumn(Class<T> clazz, Serializable pk, String column, Serializable colval)
根据主键值更新对象的column对应的值, 必须是Entity Class- 指定者:
updateColumn
在接口中DataSource
- 类型参数:
T
- Entity类的泛型- 参数:
clazz
- Entity类pk
- 主键值column
- 过滤字段名colval
- 过滤字段值- 返回:
- 更新的数据条数
-
updateColumnAsync
public <T> CompletableFuture<Integer> updateColumnAsync(Class<T> clazz, Serializable pk, String column, Serializable colval)
从接口复制的说明:DataSource
更新单个记录的单个字段
注意:即使字段标记为@Column(updatable=false)也会被更新
等价SQL: UPDATE {table} SET {column} = {value} WHERE {primary} = {id}- 指定者:
updateColumnAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类pk
- 主键column
- 待更新的字段名colval
- 更新值- 返回:
- 影响的记录条数CompletableFuture
-
updateColumnSql
protected <T> AbstractDataSqlSource.UpdateSqlInfo updateColumnSql(EntityInfo<T> info, Serializable pk, String column, Serializable colval)
-
updateColumn
public <T> int updateColumn(Class<T> clazz, String column, Serializable colval, FilterNode node)
根据主键值更新对象的column对应的值, 必须是Entity Class- 指定者:
updateColumn
在接口中DataSource
- 类型参数:
T
- Entity类的泛型- 参数:
clazz
- Entity类column
- 过滤字段名colval
- 过滤字段值node
- 过滤node 不能为null- 返回:
- 更新的数据条数
-
updateColumnAsync
public <T> CompletableFuture<Integer> updateColumnAsync(Class<T> clazz, String column, Serializable colval, FilterNode node)
从接口复制的说明:DataSource
更新符合过滤条件记录的单个字段
注意:即使字段标记为@Column(updatable=false)也会被更新
等价SQL: UPDATE {table} SET {column} = {value} WHERE {filter node}- 指定者:
updateColumnAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类column
- 待更新的字段名colval
- 更新值node
- 过滤条件- 返回:
- 影响的记录条数CompletableFuture
-
updateColumnSql
protected <T> AbstractDataSqlSource.UpdateSqlInfo updateColumnSql(EntityInfo<T> info, String column, Serializable colval, FilterNode node)
-
updateColumn
public <T> int updateColumn(Class<T> clazz, Serializable pk, ColumnValue... values)
根据主键值更新对象的多个column对应的值, 必须是Entity Class- 指定者:
updateColumn
在接口中DataSource
- 类型参数:
T
- Entity类的泛型- 参数:
clazz
- Entity类pk
- 主键值values
- 字段值- 返回:
- 更新的数据条数
-
updateColumnAsync
public <T> CompletableFuture<Integer> updateColumnAsync(Class<T> clazz, Serializable pk, ColumnValue... values)
从接口复制的说明:DataSource
更新指定主键值记录的部分字段
字段赋值操作选项见 ColumnExpress
等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} += {value2}, {column3} *= {value3}, ··· WHERE {filter node}- 指定者:
updateColumnAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类pk
- 主键values
- 更新字段- 返回:
- 影响的记录条数CompletableFuture
-
updateColumnSql
protected <T> AbstractDataSqlSource.UpdateSqlInfo updateColumnSql(EntityInfo<T> info, Serializable pk, ColumnValue... values)
-
updateColumn
public <T> int updateColumn(Class<T> clazz, FilterNode node, Flipper flipper, ColumnValue... values)
从接口复制的说明:DataSource
更新符合过滤条件的记录的指定字段
Flipper中offset字段将被忽略
注意:Entity类中标记为@Column(updatable=false)不会被更新
等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} += {value2}, {column3} *= {value3}, ··· WHERE {filter node} ORDER BY {flipper.sort}- 指定者:
updateColumn
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类node
- 过滤条件flipper
- 翻页对象values
- 更新字段- 返回:
- 影响的记录条数
-
updateColumnAsync
public <T> CompletableFuture<Integer> updateColumnAsync(Class<T> clazz, FilterNode node, Flipper flipper, ColumnValue... values)
从接口复制的说明:DataSource
更新符合过滤条件的记录的指定字段
Flipper中offset字段将被忽略
注意:Entity类中标记为@Column(updatable=false)不会被更新
等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} += {value2}, {column3} *= {value3}, ··· WHERE {filter node} ORDER BY {flipper.sort}- 指定者:
updateColumnAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类node
- 过滤条件flipper
- 翻页对象values
- 更新字段- 返回:
- 影响的记录条数CompletableFuture
-
updateColumnSql
protected <T> AbstractDataSqlSource.UpdateSqlInfo updateColumnSql(EntityInfo<T> info, FilterNode node, Flipper flipper, ColumnValue... values)
-
checkIllegalColumn
protected <T> String checkIllegalColumn(EntityInfo<T> info, SelectColumn selects)
-
updateColumn
public <T> int updateColumn(T entity, SelectColumn selects)
从接口复制的说明:DataSource
更新单个记录的指定字段
注意:Entity类中标记为@Column(updatable=false)不会被更新
等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {primary} = {bean.id}- 指定者:
updateColumn
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
entity
- 待更新的Entity对象selects
- 指定字段- 返回:
- 影响的记录条数
-
updateColumnAsync
public <T> CompletableFuture<Integer> updateColumnAsync(T entity, SelectColumn selects)
从接口复制的说明:DataSource
更新单个记录的指定字段
注意:Entity类中标记为@Column(updatable=false)不会被更新
等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {primary} = {bean.id}- 指定者:
updateColumnAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
entity
- 待更新的Entity对象selects
- 指定字段- 返回:
- 影响的记录条数CompletableFuture
-
updateColumn
public <T> int updateColumn(T entity, FilterNode node, SelectColumn selects)
从接口复制的说明:DataSource
更新符合过滤条件记录的指定字段
注意:Entity类中标记为@Column(updatable=false)不会被更新
等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {filter node}- 指定者:
updateColumn
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
entity
- 待更新的Entity对象node
- 过滤条件selects
- 指定字段- 返回:
- 影响的记录条数
-
updateColumnAsync
public <T> CompletableFuture<Integer> updateColumnAsync(T entity, FilterNode node, SelectColumn selects)
从接口复制的说明:DataSource
更新符合过滤条件记录的指定字段
注意:Entity类中标记为@Column(updatable=false)不会被更新
等价SQL: UPDATE {table} SET {column1} = {value1}, {column2} = {value2}, {column3} = {value3}, ··· WHERE {filter node}- 指定者:
updateColumnAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
entity
- 待更新的Entity对象node
- 过滤条件selects
- 指定字段- 返回:
- 影响的记录条数CompletableFuture
-
updateColumnSql
protected <T> AbstractDataSqlSource.UpdateSqlInfo updateColumnSql(EntityInfo<T> info, boolean needNode, T entity, FilterNode node, SelectColumn selects)
-
updateCache
protected <T> int updateCache(EntityInfo<T> info, int count, boolean needNode, T entity, FilterNode node, SelectColumn selects)
-
updateCache
protected <T> int updateCache(EntityInfo<T> info, int count, FilterNode node, Flipper flipper, ColumnValue... values)
-
updateCache
protected <T> int updateCache(EntityInfo<T> info, int count, Serializable pk, ColumnValue... values)
-
updateCache
protected <T> int updateCache(EntityInfo<T> info, int count, String column, Serializable colval, FilterNode node)
-
updateCache
protected <T> int updateCache(EntityInfo<T> info, int count, Serializable pk, String column, Serializable colval)
-
updateCache
protected <T> int updateCache(EntityInfo<T> info, int count, T... entitys)
-
reloadCache
public <T> int reloadCache(Class<T> clazz, Serializable... pks)
-
getNumberMap
public <N extends Number> Map<String,N> getNumberMap(Class entityClass, FilterNode node, FilterFuncColumn... columns)
从接口复制的说明:DataSource
获取符合过滤条件记录的聚合结果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}- 指定者:
getNumberMap
在接口中DataSource
- 类型参数:
N
- Number- 参数:
entityClass
- Entity类node
- 过滤条件columns
- 聚合字段- 返回:
- 聚合结果Map
-
getNumberMapAsync
public <N extends Number> CompletableFuture<Map<String,N>> getNumberMapAsync(Class entityClass, FilterNode node, FilterFuncColumn... columns)
从接口复制的说明:DataSource
获取符合过滤条件记录的聚合结果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}- 指定者:
getNumberMapAsync
在接口中DataSource
- 类型参数:
N
- Number- 参数:
entityClass
- Entity类node
- 过滤条件columns
- 聚合字段- 返回:
- 聚合结果Map
-
getNumberMapSql
protected <T> String getNumberMapSql(EntityInfo<T> info, String[] tables, FilterNode node, FilterFuncColumn... columns)
-
getNumberMapDBApply
protected <T,N extends Number> CompletableFuture<Map<String,N>> getNumberMapDBApply(EntityInfo<T> info, CompletableFuture<? extends DataResultSet> future, FilterFuncColumn... columns)
-
getNumberResult
public Number getNumberResult(Class entityClass, FilterFunc func, Number defVal, String column, FilterNode node)
从接口复制的说明:DataSource
获取符合过滤条件记录的聚合结果, 无结果返回默认值
等价SQL: SELECT FUNC{column} FROM {table} WHERE {filter node}
如 getNumberResultAsync(User.class, FilterFunc.MAX, "createtime", (FilterNode)null) 等价于: SELECT MAX(createtime) FROM {table}- 指定者:
getNumberResult
在接口中DataSource
- 参数:
entityClass
- Entity类func
- 聚合函数defVal
- 默认值column
- 指定字段node
- 过滤条件- 返回:
- 聚合结果
-
getNumberResultAsync
public CompletableFuture<Number> getNumberResultAsync(Class entityClass, FilterFunc func, Number defVal, String column, FilterNode node)
从接口复制的说明:DataSource
获取符合过滤条件记录的聚合结果, 无结果返回默认值
等价SQL: SELECT FUNC{column} FROM {table} WHERE {filter node}
如 getNumberResultAsync(User.class, FilterFunc.MAX, "createtime", (FilterNode)null) 等价于: SELECT MAX(createtime) FROM {table}- 指定者:
getNumberResultAsync
在接口中DataSource
- 参数:
entityClass
- Entity类func
- 聚合函数defVal
- 默认值column
- 指定字段node
- 过滤条件- 返回:
- 聚合结果CompletableFuture
-
getNumberResultSql
protected <T> String getNumberResultSql(EntityInfo<T> info, Class entityClass, String[] tables, FilterFunc func, Number defVal, String column, FilterNode node)
-
getNumberResultDBApply
protected <T> CompletableFuture<Number> getNumberResultDBApply(EntityInfo<T> info, CompletableFuture<? extends DataResultSet> future, Number defVal, String column)
-
queryColumnMap
public <T,K extends Serializable,N extends Number> Map<K,N> queryColumnMap(Class<T> entityClass, String keyColumn, FilterFunc func, String funcColumn, FilterNode node)
从接口复制的说明:DataSource
查询符合过滤条件记录的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- 指定者:
queryColumnMap
在接口中DataSource
- 类型参数:
T
- Entity泛型K
- Key字段的数据类型N
- Number- 参数:
entityClass
- Entity类keyColumn
- Key字段func
- 聚合函数funcColumn
- 聚合字段node
- 过滤条件- 返回:
- 聚合结果Map
-
queryColumnMapAsync
public <T,K extends Serializable,N extends Number> CompletableFuture<Map<K,N>> queryColumnMapAsync(Class<T> entityClass, String keyColumn, FilterFunc func, String funcColumn, FilterNode node)
从接口复制的说明:DataSource
查询符合过滤条件记录的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- 指定者:
queryColumnMapAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型K
- Key字段的数据类型N
- Number- 参数:
entityClass
- Entity类keyColumn
- Key字段func
- 聚合函数funcColumn
- 聚合字段node
- 过滤条件- 返回:
- 聚合结果Map CompletableFuture
-
queryColumnMapSql
protected <T> String queryColumnMapSql(EntityInfo<T> info, String[] tables, String keyColumn, FilterFunc func, String funcColumn, FilterNode node)
-
queryColumnMapDBApply
protected <T,K extends Serializable,N extends Number> CompletableFuture<Map<K,N>> queryColumnMapDBApply(EntityInfo<T> info, CompletableFuture<? extends DataResultSet> future, String keyColumn)
-
queryColumnMap
public <T,K extends Serializable,N extends Number> Map<K,N[]> queryColumnMap(Class<T> entityClass, ColumnNode[] funcNodes, String groupByColumn, FilterNode node)
从接口复制的说明:DataSource
查询符合过滤条件记录的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- 指定者:
queryColumnMap
在接口中DataSource
- 类型参数:
T
- Entity泛型K
- Key字段的数据类型N
- Number- 参数:
entityClass
- Entity类funcNodes
- ColumnNode[]groupByColumn
- GROUP BY字段node
- 过滤条件- 返回:
- 聚合结果Map CompletableFuture
-
queryColumnMapAsync
public <T,K extends Serializable,N extends Number> CompletableFuture<Map<K,N[]>> queryColumnMapAsync(Class<T> entityClass, ColumnNode[] funcNodes, String groupByColumn, FilterNode node)
从接口复制的说明:DataSource
查询符合过滤条件记录的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- 指定者:
queryColumnMapAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型K
- Key字段的数据类型N
- Number- 参数:
entityClass
- Entity类funcNodes
- ColumnNode[]groupByColumn
- GROUP BY字段node
- 过滤条件- 返回:
- 聚合结果Map CompletableFuture
-
queryColumnMap
public <T,K extends Serializable,N extends Number> Map<K[],N[]> queryColumnMap(Class<T> entityClass, ColumnNode[] funcNodes, String[] groupByColumns, FilterNode node)
从接口复制的说明:DataSource
查询符合过滤条件记录的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- 指定者:
queryColumnMap
在接口中DataSource
- 类型参数:
T
- Entity泛型K
- Key字段的数据类型N
- Number- 参数:
entityClass
- Entity类funcNodes
- ColumnNode[]groupByColumns
- GROUP BY字段node
- 过滤条件- 返回:
- 聚合结果Map
-
queryColumnMapAsync
public <T,K extends Serializable,N extends Number> CompletableFuture<Map<K[],N[]>> queryColumnMapAsync(Class<T> entityClass, ColumnNode[] funcNodes, String[] groupByColumns, FilterNode node)
从接口复制的说明:DataSource
查询符合过滤条件记录的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- 指定者:
queryColumnMapAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型K
- Key字段的数据类型N
- Number- 参数:
entityClass
- Entity类funcNodes
- ColumnNode[]groupByColumns
- GROUP BY字段node
- 过滤条件- 返回:
- 聚合结果Map CompletableFuture
-
queryColumnMapSql
protected <T> String queryColumnMapSql(EntityInfo<T> info, String[] tables, ColumnNode[] funcNodes, String[] groupByColumns, FilterNode node)
-
queryColumnMapDBApply
protected <T,K extends Serializable,N extends Number> CompletableFuture<Map<K[],N[]>> queryColumnMapDBApply(EntityInfo<T> info, CompletableFuture<? extends DataResultSet> future, ColumnNode[] funcNodes, String[] groupByColumns)
-
finds
public <T> T[] finds(Class<T> clazz, SelectColumn selects, Serializable... pks)
从接口复制的说明:DataSource
获取指定主键值的多个记录, 返回数组,数组长度与pks一样
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {primary} = {id1,id2, ···}- 指定者:
finds
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类selects
- 指定字段pks
- 主键值集合- 返回:
- Entity对象
-
findsAsync
public <T> CompletableFuture<T[]> findsAsync(Class<T> clazz, SelectColumn selects, Serializable... pks)
从接口复制的说明:DataSource
获取指定主键值的多个记录, 返回数组,数组长度与pks一样
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {primary} = {id1,id2, ···}- 指定者:
findsAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类selects
- 指定字段pks
- 主键值集合- 返回:
- Entity对象CompletableFuture
-
findsDBAsync
protected <T> CompletableFuture<T[]> findsDBAsync(EntityInfo<T> info, SelectColumn selects, Serializable... pks)
-
findsList
public <D extends Serializable,T> List<T> findsList(Class<T> clazz, Stream<D> pks)
从接口复制的说明:DataSource
获取指定主键值的多个记录, 返回列表
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {primary} = {id1,id2, ···}- 指定者:
findsList
在接口中DataSource
- 类型参数:
D
- 主键泛型T
- Entity泛型- 参数:
clazz
- Entity类pks
- 主键值集合- 返回:
- Entity对象
-
findsListAsync
public <D extends Serializable,T> CompletableFuture<List<T>> findsListAsync(Class<T> clazz, Stream<D> pks)
从接口复制的说明:DataSource
获取指定主键值的多个记录, 返回列表
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {primary} = {id1,id2, ···}- 指定者:
findsListAsync
在接口中DataSource
- 类型参数:
D
- 主键泛型T
- Entity泛型- 参数:
clazz
- Entity类pks
- 主键值集合- 返回:
- Entity对象
-
find
public <T> T find(Class<T> clazz, SelectColumn selects, Serializable pk)
从接口复制的说明:DataSource
获取指定主键值的单个记录, 返回null表示不存在值
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {primary} = {id}- 指定者:
find
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类selects
- 指定字段pk
- 主键值- 返回:
- Entity对象
-
findAsync
public <T> CompletableFuture<T> findAsync(Class<T> clazz, SelectColumn selects, Serializable pk)
从接口复制的说明:DataSource
获取指定主键值的单个记录, 返回null表示不存在值
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {primary} = {id}- 指定者:
findAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类selects
- 指定字段pk
- 主键值- 返回:
- Entity对象CompletableFuture
-
findUnCache
protected <T> T findUnCache(EntityInfo<T> info, SelectColumn selects, Serializable pk)
-
findUnCacheAsync
protected <T> CompletableFuture<T> findUnCacheAsync(EntityInfo<T> info, SelectColumn selects, Serializable pk)
-
findSql
protected <T> String findSql(EntityInfo<T> info, SelectColumn selects, Serializable pk)
-
find
public <T> T find(Class<T> clazz, SelectColumn selects, FilterNode node)
从接口复制的说明:DataSource
获取符合过滤条件单个记录, 返回null表示不存在值
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter node}- 指定者:
find
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类selects
- 指定字段node
- 过滤条件- 返回:
- Entity对象
-
findAsync
public <T> CompletableFuture<T> findAsync(Class<T> clazz, SelectColumn selects, FilterNode node)
从接口复制的说明:DataSource
获取符合过滤条件单个记录, 返回null表示不存在值
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter node}- 指定者:
findAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类selects
- 指定字段node
- 过滤条件- 返回:
- Entity对象 CompletableFuture
-
findSql
protected <T> String findSql(EntityInfo<T> info, String[] tables, SelectColumn selects, FilterNode node)
-
findDBApply
protected <T> CompletableFuture<T> findDBApply(EntityInfo<T> info, CompletableFuture<? extends DataResultSet> future, boolean onlypk, SelectColumn selects)
-
findColumn
public <T> Serializable findColumn(Class<T> clazz, String column, Serializable defValue, Serializable pk)
从接口复制的说明:DataSource
获取符合过滤条件单个记录的单个字段值, 不存在值则返回默认值
等价SQL: SELECT {column} FROM {table} WHERE {primary} = {id}- 指定者:
findColumn
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类column
- 字段名defValue
- 默认值pk
- 主键值- 返回:
- 字段值
-
findColumnAsync
public <T> CompletableFuture<Serializable> findColumnAsync(Class<T> clazz, String column, Serializable defValue, Serializable pk)
从接口复制的说明:DataSource
获取符合过滤条件单个记录的单个字段值, 不存在值则返回默认值
等价SQL: SELECT {column} FROM {table} WHERE {primary} = {id}- 指定者:
findColumnAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类column
- 字段名defValue
- 默认值pk
- 主键值- 返回:
- 字段值 CompletableFuture
-
findColumnSql
protected <T> String findColumnSql(EntityInfo<T> info, String column, Serializable defValue, Serializable pk)
-
findColumn
public <T> Serializable findColumn(Class<T> clazz, String column, Serializable defValue, FilterNode node)
从接口复制的说明:DataSource
获取符合过滤条件单个记录的单个字段值, 不存在值则返回默认值
等价SQL: SELECT {column} FROM {table} WHERE {filter node}- 指定者:
findColumn
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类column
- 字段名defValue
- 默认值node
- 过滤条件- 返回:
- 字段值
-
findColumnAsync
public <T> CompletableFuture<Serializable> findColumnAsync(Class<T> clazz, String column, Serializable defValue, FilterNode node)
从接口复制的说明:DataSource
获取符合过滤条件单个记录的单个字段值, 不存在值则返回默认值
等价SQL: SELECT {column} FROM {table} WHERE {filter node}- 指定者:
findColumnAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类column
- 字段名defValue
- 默认值node
- 过滤条件- 返回:
- 字段值 CompletableFuture
-
findColumnSql
protected <T> String findColumnSql(EntityInfo<T> info, String[] tables, String column, Serializable defValue, FilterNode node)
-
findColumnDBApply
protected <T> CompletableFuture<Serializable> findColumnDBApply(EntityInfo<T> info, CompletableFuture<? extends DataResultSet> future, boolean onlypk, String column, Serializable defValue)
-
exists
public <T> boolean exists(Class<T> clazz, Serializable pk)
从接口复制的说明:DataSource
判断是否存在主键值的记录
等价SQL: SELECT COUNT(*) FROM {table} WHERE {primary} = {id}- 指定者:
exists
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类pk
- 主键值- 返回:
- 是否存在
-
existsAsync
public <T> CompletableFuture<Boolean> existsAsync(Class<T> clazz, Serializable pk)
从接口复制的说明:DataSource
判断是否存在主键值的记录
等价SQL: SELECT COUNT(*) FROM {table} WHERE {primary} = {id}- 指定者:
existsAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类pk
- 主键值- 返回:
- 是否存在CompletableFuture
-
existsSql
protected <T> String existsSql(EntityInfo<T> info, Serializable pk)
-
exists
public <T> boolean exists(Class<T> clazz, FilterNode node)
从接口复制的说明:DataSource
判断是否存在符合过滤条件的记录
等价SQL: SELECT COUNT(*) FROM {table} WHERE {filter node}- 指定者:
exists
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类node
- 过滤条件- 返回:
- 是否存在
-
existsAsync
public <T> CompletableFuture<Boolean> existsAsync(Class<T> clazz, FilterNode node)
从接口复制的说明:DataSource
判断是否存在符合过滤条件的记录
等价SQL: SELECT COUNT(*) FROM {table} WHERE {filter node}- 指定者:
existsAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类node
- 过滤条件- 返回:
- 是否存在CompletableFuture
-
existsSql
protected <T> String existsSql(EntityInfo<T> info, String[] tables, FilterNode node)
-
existsDBApply
protected <T> CompletableFuture<Boolean> existsDBApply(EntityInfo<T> info, CompletableFuture<? extends DataResultSet> future, boolean onlypk)
-
queryColumnSet
public <T,V extends Serializable> Set<V> queryColumnSet(String selectedColumn, Class<T> clazz, Flipper flipper, FilterNode node)
从接口复制的说明:DataSource
查询符合过滤条件记录的某个字段Set集合
等价SQL: SELECT DISTINCT {selectedColumn} FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}- 指定者:
queryColumnSet
在接口中DataSource
- 类型参数:
T
- Entity泛型V
- 字段类型- 参数:
selectedColumn
- 指定字段clazz
- Entity类flipper
- 翻页对象node
- 过滤条件- 返回:
- 字段值的集合
-
queryColumnSetAsync
public <T,V extends Serializable> CompletableFuture<Set<V>> queryColumnSetAsync(String selectedColumn, Class<T> clazz, Flipper flipper, FilterNode node)
从接口复制的说明:DataSource
查询符合过滤条件记录的某个字段Set集合
等价SQL: SELECT DISTINCT {selectedColumn} FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}- 指定者:
queryColumnSetAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型V
- 字段类型- 参数:
selectedColumn
- 指定字段clazz
- Entity类flipper
- 翻页对象node
- 过滤条件- 返回:
- 字段值的集合CompletableFuture
-
queryColumnList
public <T,V extends Serializable> List<V> queryColumnList(String selectedColumn, Class<T> clazz, Flipper flipper, FilterNode node)
从接口复制的说明:DataSource
查询符合过滤条件记录的某个字段List集合
等价SQL: SELECT {selectedColumn} FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}- 指定者:
queryColumnList
在接口中DataSource
- 类型参数:
T
- Entity泛型V
- 字段类型- 参数:
selectedColumn
- 指定字段clazz
- Entity类flipper
- 翻页对象node
- 过滤条件- 返回:
- 字段值的集合
-
queryColumnListAsync
public <T,V extends Serializable> CompletableFuture<List<V>> queryColumnListAsync(String selectedColumn, Class<T> clazz, Flipper flipper, FilterNode node)
从接口复制的说明:DataSource
查询符合过滤条件记录的某个字段List集合
等价SQL: SELECT {selectedColumn} FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}- 指定者:
queryColumnListAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型V
- 字段类型- 参数:
selectedColumn
- 指定字段clazz
- Entity类flipper
- 翻页对象node
- 过滤条件- 返回:
- 字段值的集合CompletableFuture
-
queryColumnSheet
public <T,V extends Serializable> Sheet<V> queryColumnSheet(String selectedColumn, Class<T> clazz, Flipper flipper, FilterNode node)
从接口复制的说明:DataSource
查询符合过滤条件记录的某个字段Sheet集合
等价SQL: SELECT {selectedColumn} FROM {table} WHERE {filter bean} ORDER BY {flipper.sort} LIMIT {flipper.limit}- 指定者:
queryColumnSheet
在接口中DataSource
- 类型参数:
T
- Entity泛型V
- 字段类型- 参数:
selectedColumn
- 指定字段clazz
- Entity类flipper
- 翻页对象node
- 过滤条件- 返回:
- 字段值的集合
-
queryColumnSheetAsync
public <T,V extends Serializable> CompletableFuture<Sheet<V>> queryColumnSheetAsync(String selectedColumn, Class<T> clazz, Flipper flipper, FilterNode node)
从接口复制的说明:DataSource
查询符合过滤条件记录的某个字段Sheet集合
等价SQL: SELECT {selectedColumn} FROM {table} WHERE {filter bean} ORDER BY {flipper.sort} LIMIT {flipper.limit}- 指定者:
queryColumnSheetAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型V
- 字段类型- 参数:
selectedColumn
- 指定字段clazz
- Entity类flipper
- 翻页对象node
- 过滤条件- 返回:
- 字段值的集合CompletableFuture
-
queryMap
public <K extends Serializable,T> Map<K,T> queryMap(Class<T> clazz, SelectColumn selects, Stream<K> keyStream)
查询符合过滤条件记录的Map集合, 主键值为key
等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit}- 指定者:
queryMap
在接口中DataSource
- 类型参数:
K
- 主键泛型T
- Entity泛型- 参数:
clazz
- Entity类selects
- 指定字段keyStream
- 主键Stream- 返回:
- Entity的集合
-
queryMapAsync
public <K extends Serializable,T> CompletableFuture<Map<K,T>> queryMapAsync(Class<T> clazz, SelectColumn selects, Stream<K> keyStream)
从接口复制的说明:DataSource
查询符合过滤条件记录的List转Map集合, key=主键值, value=Entity对象
等价SQL: SELECT * FROM {table} WHERE id IN {ids}- 指定者:
queryMapAsync
在接口中DataSource
- 类型参数:
K
- 主键泛型T
- Entity泛型- 参数:
clazz
- Entity类selects
- 指定字段keyStream
- 主键Stream- 返回:
- Entity的集合CompletableFuture
-
queryMap
public <K extends Serializable,T> Map<K,T> queryMap(Class<T> clazz, SelectColumn selects, FilterNode node)
查询符合过滤条件记录的Map集合, 主键值为key
等价SQL: SELECT * FROM {table} WHERE {column} = {key} ORDER BY {flipper.sort} LIMIT {flipper.limit}- 指定者:
queryMap
在接口中DataSource
- 类型参数:
K
- 主键泛型T
- Entity泛型- 参数:
clazz
- Entity类selects
- 指定字段node
- FilterNode- 返回:
- Entity的集合
-
queryMapAsync
public <K extends Serializable,T> CompletableFuture<Map<K,T>> queryMapAsync(Class<T> clazz, SelectColumn selects, FilterNode node)
从接口复制的说明:DataSource
查询符合过滤条件记录的List转Map集合, key=主键值, value=Entity对象
等价SQL: SELECT * FROM {table} WHERE {filter node}- 指定者:
queryMapAsync
在接口中DataSource
- 类型参数:
K
- 主键泛型T
- Entity泛型- 参数:
clazz
- Entity类selects
- 指定字段node
- FilterNode- 返回:
- Entity的集合CompletableFuture
-
querySet
public <T> Set<T> querySet(Class<T> clazz, SelectColumn selects, Flipper flipper, FilterNode node)
从接口复制的说明:DataSource
查询符合过滤条件记录的Set集合
等价SQL: SELECT DISTINCT {column1},{column2}, ··· FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}- 指定者:
querySet
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类selects
- 指定字段flipper
- 翻页对象node
- 过滤条件- 返回:
- Entity的集合
-
querySetAsync
public <T> CompletableFuture<Set<T>> querySetAsync(Class<T> clazz, SelectColumn selects, Flipper flipper, FilterNode node)
从接口复制的说明:DataSource
查询符合过滤条件记录的Set集合
等价SQL: SELECT DISTINCT {column1},{column2}, ··· FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}- 指定者:
querySetAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类selects
- 指定字段flipper
- 翻页对象node
- 过滤条件- 返回:
- Entity的集合CompletableFuture
-
queryList
public <T> List<T> queryList(Class<T> clazz, SelectColumn selects, Flipper flipper, FilterNode node)
从接口复制的说明:DataSource
查询符合过滤条件记录的List集合
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}- 指定者:
queryList
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类selects
- 指定字段flipper
- 翻页对象node
- 过滤条件- 返回:
- Entity的集合
-
queryListAsync
public <T> CompletableFuture<List<T>> queryListAsync(Class<T> clazz, SelectColumn selects, Flipper flipper, FilterNode node)
从接口复制的说明:DataSource
查询符合过滤条件记录的List集合
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}- 指定者:
queryListAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类selects
- 指定字段flipper
- 翻页对象node
- 过滤条件- 返回:
- Entity的集合CompletableFuture
-
querySheet
public <T> Sheet<T> querySheet(Class<T> clazz, SelectColumn selects, Flipper flipper, FilterNode node)
从接口复制的说明:DataSource
查询符合过滤条件记录的Sheet集合
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}- 指定者:
querySheet
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类selects
- 指定字段flipper
- 翻页对象node
- 过滤条件- 返回:
- Entity的集合
-
querySheetAsync
public <T> CompletableFuture<Sheet<T>> querySheetAsync(Class<T> clazz, SelectColumn selects, Flipper flipper, FilterNode node)
从接口复制的说明:DataSource
查询符合过滤条件记录的Sheet集合
等价SQL: SELECT {column1},{column2}, ··· FROM {table} WHERE {filter node} ORDER BY {flipper.sort} LIMIT {flipper.limit}- 指定者:
querySheetAsync
在接口中DataSource
- 类型参数:
T
- Entity泛型- 参数:
clazz
- Entity类selects
- 指定字段flipper
- 翻页对象node
- 过滤条件- 返回:
- Entity的集合CompletableFuture
-
querySheet
protected <T> Sheet<T> querySheet(boolean readCache, boolean needTotal, boolean distinct, Class<T> clazz, SelectColumn selects, Flipper flipper, FilterNode node)
-
querySheetAsync
protected <T> CompletableFuture<Sheet<T>> querySheetAsync(boolean readCache, boolean needTotal, boolean distinct, Class<T> clazz, SelectColumn selects, Flipper flipper, FilterNode node)
-
nativeQuery
public <V> V nativeQuery(String sql, BiConsumer<Object,Object> consumer, Function<DataResultSet,V> handler, Map<String,Object> params)
从接口复制的说明:DataSqlSource
通过原生带参数的sql查询结果- 指定者:
nativeQuery
在接口中DataSqlSource
- 类型参数:
V
- 泛型- 参数:
sql
- 带参数的sql语句consumer
- BiConsumer 参数1: connection, 参数2: statementhandler
- DataResultSet的回调函数params
- 参数值集合- 返回:
- 结果对象
-
nativeQuery
public <V> V nativeQuery(String sql, BiConsumer<Object,Object> consumer, Function<DataResultSet,V> handler)
从接口复制的说明:DataSqlSource
通过原生的sql查询结果- 指定者:
nativeQuery
在接口中DataSqlSource
- 类型参数:
V
- 泛型- 参数:
sql
- 无参数的sql语句consumer
- BiConsumer 参数1: connection, 参数2: statementhandler
- DataResultSet的回调函数- 返回:
- 结果对象
-
nativeQuerySheet
public <V> Sheet<V> nativeQuerySheet(Class<V> type, String sql, RowBound round, Map<String,Object> params)
- 指定者:
nativeQuerySheet
在接口中DataSqlSource
-
nativeUpdate
public int nativeUpdate(String sql, Map<String,Object> params)
从接口复制的说明:DataSqlSource
执行原生带参数的sql- 指定者:
nativeUpdate
在接口中DataSqlSource
- 参数:
sql
- 带参数的sql语句params
- 参数值集合- 返回:
- 执行条数
-
nativeUpdate
public int nativeUpdate(String sql)
从接口复制的说明:DataSqlSource
执行原生无参数的sql- 指定者:
nativeUpdate
在接口中DataSqlSource
- 参数:
sql
- 无参数的sql语句- 返回:
- 执行条数
-
nativeUpdates
public int[] nativeUpdates(String... sqls)
从接口复制的说明:DataSqlSource
执行多条原生无参数的sql- 指定者:
nativeUpdates
在接口中DataSqlSource
- 参数:
sqls
- 无参数的sql语句- 返回:
- 执行条数
-
-