接口 RunPrepare
- 所有超级接口:
Cloneable
- 所有已知子接口:
AutoPrepare,TablePrepare,TextPrepare,TextPrepare
- 所有已知实现类:
AbstractRunPrepare,DefaultAutoPrepare,DefaultTablePrepare,DefaultTextPrepare,DefaultTextPrepare,SimplePrepare,VirtualTablePrepare
-
字段概要
字段 -
方法概要
修饰符和类型方法说明添加列 CD CD, NMaddCondition(String column, Object value) addCondition(Condition condition) addCondition(Compare compare, String column, Object value) 添加查询条件addFetchKey(String... fetchKeys) addFetchKey(Collection<String> fetchKeys) addPrimaryKey(String... primaryKeys) addPrimaryKey(Collection<String> primaryKeys) aggregation(List<AggregationConfig> configs) aggregation(AggregationConfig... configs) aggregation(Aggregation aggregation, String column, String result) 利用RunPrepare构造更复杂的SQLbuild(DataRuntime runtime) clone()condition(ConfigStore configs) default boolean是否一次性的(执行过程中可修改,否则应该clone一份,避免影响第二闪使用)disposable(boolean disposable) excludeColumn(String columns) default voidfilter(LinkedHashMap<String, Column> metadatas) 过滤不存在的列getAlias()intgetBatch()getDest()getId()getJoin()getJoins()getTable()getText()int添加分组条件, 在之前的基础上添加新分组条件, 有重复条件则覆盖group(GroupStore groups) groups()booleanhaving()having(ConfigStore having) boolean相同ID是否有多个booleanisStrict()是否严格格式,不能追加未定义的条件booleanjoin(RunPrepare prepare) default RunPreparejoin(RunPrepare prepare, Join join) default RunPreparejoin(RunPrepare prepare, Join.TYPE type, String... conditions) default RunPreparejoin(RunPrepare prepare, Join.TYPE type, ConfigStore configs) default Stringjson()default Stringjson(boolean empty) default DataRowmap()default DataRowmap(boolean empty) map(boolean empty, boolean join) 添加排序条件, 在之前的基础上添加新排序条件, 有重复条件则覆盖order(String col, Order.TYPE type) order(OrderStore order) default booleanparse()是否需要解析sqlvoidsetBatch(int batch) setCatalog(String catalog) setConditionValue(String condition, String variable, Object value) 设置查询条件变量值设置查询或操作的目标(表、存储过程、SQL等)setDistinct(boolean distinct) setExcludeColumns(String... columns) setExcludeColumns(List<String> excludeColumn) setFetchKey(String... fetchKeys) setFetchKey(Collection<String> fetchKeys) default RunPreparedefault RunPreparesetJoin(Join.TYPE type, ConfigStore configs) setMultiple(boolean multiple) voidsetOrders(OrderStore orders) voidsetPageNavi(PageNavi navi) setPrimaryKey(String... primaryKeys) setPrimaryKey(Collection<String> primaryKeys) setRuntime(String runtime) 用来标记运行环境key(其中关联了数据源与适配器)
经常在service方法参数前加数据源前缀缀时会用到setSelectColumns(String... columns) setSelectColumns(List<String> columns) voidsetStrict(boolean strict) 设置SQL文本, 从XML中text标签中取出setUnionAll(boolean all) union(List<RunPrepare> prepare) union(List<RunPrepare> prepares, boolean all) union(RunPrepare prepare) union(RunPrepare prepare, boolean all) default RunPrepareunionAll(List<RunPrepare> prepare) default RunPrepareunionAll(RunPrepare prepare)
-
字段详细资料
-
方法详细资料
-
parse
default boolean parse()是否需要解析sql- 返回:
- boolean
-
disposable
default boolean disposable()是否一次性的(执行过程中可修改,否则应该clone一份,避免影响第二闪使用)- 返回:
- boolean
-
disposable
-
getId
String getId() -
setId
-
getJoin
Join getJoin() -
setJoin
-
setJoin
-
setJoin
-
setDest
设置查询或操作的目标(表、存储过程、SQL等)查询全部列 : setDataSource("V_ADMIN")
查询指定列 : setDataSource(ADMIN(CD, ACCOUNT, NAME, REG_TIME))
查询指定列 : setDataSource(ADMIN(DISTINCT CD, ACCOUNT, NAME, REG_TIME))
查询指定列 : setDataSource(ADMIN(DISTINCT {NEWID()}, {getDate()}, CD, ACCOUNT, NAME, REG_TIME))
{}中内容按原样拼接到运行时SQL, 其他列将添加[]以避免关键重复根据XML定义SQL : setDataSource("admin.power:S_POWER")
admin.power : XML文件路径, 文件目录以.分隔
S_POWER : 自定义SQL的id- 参数:
dest- 数据源 : 表|视图|自定义SQL.id- 返回:
- Run 最终执行命令 如JDBC环境中的 SQL 与 参数值
-
setDest
-
getDest
String getDest() -
setCatalog
-
getCatalog
Catalog getCatalog() -
getCatalogName
String getCatalogName() -
setSchema
-
getSchema
Schema getSchema() -
getSchemaName
String getSchemaName() -
getTable
Table getTable() -
getTableName
String getTableName() -
setRuntime
用来标记运行环境key(其中关联了数据源与适配器)
经常在service方法参数前加数据源前缀缀时会用到- 参数:
runtime- runtime.key- 返回:
- RunPrepare
-
getRuntime
String getRuntime() -
order
添加排序条件, 在之前的基础上添加新排序条件, 有重复条件则覆盖- 参数:
order- order- 返回:
- Run 最终执行命令 如JDBC环境中的 SQL 与 参数值
-
order
-
order
-
order
-
group
添加分组条件, 在之前的基础上添加新分组条件, 有重复条件则覆盖- 参数:
groups- groups- 返回:
- Run 最终执行命令 如JDBC环境中的 SQL 与 参数值
-
group
-
having
-
having
-
addCondition
添加查询条件- 参数:
column- 列名value- 值compare- 比较方式- 返回:
- Run 最终执行命令 如JDBC环境中的 SQL 与 参数值
-
addCondition
-
setText
设置SQL文本, 从XML中text标签中取出- 参数:
text- text- 返回:
- Run 最终执行命令 如JDBC环境中的 SQL 与 参数值
-
setConditionValue
设置查询条件变量值- 参数:
condition- 条件IDvariable- 变量value- 值- 返回:
- Run 最终执行命令 如JDBC环境中的 SQL 与 参数值
-
getOrders
OrderStore getOrders() -
getGroups
GroupStore getGroups() -
having
ConfigStore having() -
setOrders
-
getVersion
int getVersion() -
getConditionChain
ConditionChain getConditionChain() -
addCondition
-
getText
String getText() -
getSQLVariables
-
addPrimaryKey
-
addPrimaryKey
-
setPrimaryKey
-
setPrimaryKey
-
getPrimaryKeys
-
getPrimaryKey
String getPrimaryKey() -
hasPrimaryKeys
boolean hasPrimaryKeys() -
addFetchKey
-
addFetchKey
-
setFetchKey
-
setFetchKey
-
getFetchKeys
-
setSelectColumns
-
setSelectColumns
-
getColumns
LinkedHashMap<String,Column> getColumns() -
getExcludes
-
setExcludeColumns
-
setExcludeColumns
-
addColumn
添加列 CD CD, NM- 参数:
columns- columns
-
addColumn
-
excludeColumn
-
join
-
inner
-
left
-
right
-
full
-
setAlias
-
getAlias
String getAlias() -
isMultiple
boolean isMultiple()相同ID是否有多个- 返回:
- boolean
-
setMultiple
-
isStrict
boolean isStrict()是否严格格式,不能追加未定义的条件- 返回:
- boolean
-
setStrict
void setStrict(boolean strict) -
setBatch
void setBatch(int batch) -
getBatch
int getBatch() -
condition
ConfigStore condition() -
condition
-
setUnionAll
-
isUnionAll
boolean isUnionAll() -
union
-
union
-
unionAll
-
union
-
union
-
unionAll
-
getUnions
List<RunPrepare> getUnions() -
getJoins
List<RunPrepare> getJoins() -
join
-
join
-
join
-
join
-
filter
过滤不存在的列- 参数:
metadatas- 可用范围
-
getDistinct
String getDistinct() -
setDistinct
-
build
-
map
-
map
-
map
-
json
-
json
-
groups
GroupStore groups() -
aggregation
-
aggregation
-
aggregation
-
aggregations
List<AggregationConfig> aggregations() -
box
利用RunPrepare构造更复杂的SQL- 参数:
box- CREATE VIEW AS ${body} 其中${body}会替换成this.sql- 返回:
- this
-
clone
RunPrepare clone()
-