public abstract class SelectorBase<S extends SelectorBase<S,Q>,Q extends IBaseQuery<?,Q>> extends AggregateSegment<S,Q,S>
aggregate, and, avg, count, group_concat, max, min, origin, sumcurrent, wrapper| 限定符 | 构造器和说明 |
|---|---|
protected |
SelectorBase(Q query) |
protected |
SelectorBase(S origin,
IAggregate aggregate) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected S |
apply() |
S |
apply(FieldMapping... columns)
增加查询字段
|
S |
apply(FieldPredicate predicate)
过滤查询的字段信息
例1: 只要 java 字段名以 "test" 开头的 -> select(i -> i.getProperty().startsWith("test"))
例2: 要全部字段 -> select(i -> true)
例3: 只要字符串类型字段 -> select(i -> i.getPropertyType instance String)
|
S |
apply(String column,
String... columns)
增加查询字段
|
S |
applyAs(FieldMapping field,
String alias)
增加带别名的查询字段
|
S |
applyAs(String column,
String alias)
增加带别名的查询字段
|
S |
count(String alias)
count(*) as alias
|
protected S |
process(FieldMapping field,
String alias)
对当前字段处理,别名处理
|
aggregateSegment, getOriginbyEntity, byExclude, columnWithAlias, currentWithAlias, end, fieldMapping, get, setprotected SelectorBase(Q query)
protected SelectorBase(S origin, IAggregate aggregate)
public S apply(FieldMapping... columns)
columns - 查询字段public S applyAs(FieldMapping field, String alias)
field - 查询字段alias - 别名, 为空时没有别名public S applyAs(String column, String alias)
column - 查询字段alias - 别名, 为空时没有别名public S apply(FieldPredicate predicate)
例1: 只要 java 字段名以 "test" 开头的 -> select(i -> i.getProperty().startsWith("test"))
例2: 要全部字段 -> select(i -> true)
例3: 只要字符串类型字段 -> select(i -> i.getPropertyType instance String)
predicate - 过滤方式 (主键除外!)protected S apply()
apply 在类中 BaseSegment<S extends SelectorBase<S,Q>,Q extends IBaseQuery<?,Q>>protected S process(FieldMapping field, String alias)
field - 字段alias - 别名Copyright © 2021. All rights reserved.