接口 FilterParams
-
- 所有已知实现类:
AbstractFilterParams,DocFilterParams,TableFilterParams
public interface FilterParamsTransforms X DevAPI filter parameters into X Protocol message entities. Used internally.
-
-
嵌套类概要
嵌套类 修饰符和类型 接口 说明 static classFilterParams.RowLockThe type of row lock.static classFilterParams.RowLockOptionsOptions that define the behavior while retrieving locked rows.
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 voidaddArg(String name, Object value)Set binding.voidclearArgs()Remove all current bindings.ObjectgetArgs()Get binding arguments.ObjectgetCollection()Get X Protocol Collection object.ObjectgetCriteria()Get the search criteria.ObjectgetFields()Get X Protocol Projection objects.ObjectgetGrouping()Get X Protocol Expr objects for groupBy.ObjectgetGroupingCriteria()Get X Protocol Expr objects for grouping criteria.LonggetLimit()Get max number of rows to filter.FilterParams.RowLockgetLock()GetFilterParams.RowLockvalue.FilterParams.RowLockOptionsgetLockOption()GetFilterParams.RowLockOptionsvalue.LonggetOffset()Get number of rows to skip before finding others.ObjectgetOrder()Get X Protocol Order objects.booleanisRelational()Are relational columns identifiers allowed?voidsetCriteria(String criteriaString)Parse criteriaString into X Protocol Expr object.voidsetFields(String... projection)Parse projection expressions into X Protocol Projection objects.voidsetGrouping(String... groupBy)Parse groupBy expressions into X Protocol Expr objects.voidsetGroupingCriteria(String having)Parse having expressions into X Protocol Expr objects.voidsetLimit(Long limit)Set maximum rows to find.voidsetLock(FilterParams.RowLock rowLock)SetFilterParams.RowLockvalue.voidsetLockOption(FilterParams.RowLockOptions rowLockOption)SetFilterParams.RowLockOptionsvalue.voidsetOffset(Long offset)Set number of rows to skip before finding others.voidsetOrder(String... orderExpression)Parse order expressions into X Protocol Order objects.booleansupportsOffset()Whether offset clause is supported in the statement or not.voidverifyAllArgsBound()Verify that all arguments are bound.
-
-
-
方法详细资料
-
getCollection
Object getCollection()
Get X Protocol Collection object.- 返回:
- X Protocol Collection object
-
getOrder
Object getOrder()
Get X Protocol Order objects.- 返回:
- List of X Protocol Order objects
-
setOrder
void setOrder(String... orderExpression)
Parse order expressions into X Protocol Order objects.DocResult docs = this.collection.find().orderBy("$._id").execute(); docs = this.collection.find().sort("$.x", "$.y").execute();- 参数:
orderExpression- order expressions
-
getLimit
Long getLimit()
Get max number of rows to filter.- 返回:
- limit
-
setLimit
void setLimit(Long limit)
Set maximum rows to find.For example, to find the 3 first rows:
docs = this.collection.find().orderBy("$._id").limit(3).execute();- 参数:
limit- maximum rows to find
-
getOffset
Long getOffset()
Get number of rows to skip before finding others.- 返回:
- maximum rows to skip
-
setOffset
void setOffset(Long offset)
Set number of rows to skip before finding others.For example, to skip 1 row and find other 3 rows:
docs = this.collection.find().orderBy("$._id").limit(3).skip(1).execute();- 参数:
offset- maximum rows to skip
-
supportsOffset
boolean supportsOffset()
Whether offset clause is supported in the statement or not.Note that setting offset values is always possible, even if they are not supported.
- 返回:
trueif offset clause is supported
-
getCriteria
Object getCriteria()
Get the search criteria.- 返回:
- X Protocol Expr object
-
setCriteria
void setCriteria(String criteriaString)
Parse criteriaString into X Protocol Expr object.docs = this.collection.find("$.x1 = 29 | 15").execute(); table.delete().where("age == 13").execute();- 参数:
criteriaString- expression
-
getArgs
Object getArgs()
Get binding arguments.- 返回:
- List of X Protocol Scalar object
-
addArg
void addArg(String name, Object value)
Set binding.this.collection.find("a = :arg1 or b = :arg2").bind("arg1", 1).bind("arg2", 2).execute();- 参数:
name- bind keyvalue- bind value
-
verifyAllArgsBound
void verifyAllArgsBound()
Verify that all arguments are bound. ThrowsWrongArgumentExceptionif any placeholder argument is not bound.
-
clearArgs
void clearArgs()
Remove all current bindings.
-
isRelational
boolean isRelational()
Are relational columns identifiers allowed?- 返回:
- true if allowed
-
setFields
void setFields(String... projection)
Parse projection expressions into X Protocol Projection objects.collection.find().fields("CAST($.x as SIGNED) as x").execute(); table.select("_id, name, birthday, age").execute(); table.select("age as age_group, count(name) as cnt, something").execute();- 参数:
projection- projection expression
-
getFields
Object getFields()
Get X Protocol Projection objects.- 返回:
- List of X Protocol Projection objects.
-
setGrouping
void setGrouping(String... groupBy)
Parse groupBy expressions into X Protocol Expr objects.SelectStatement stmt = table.select("age as age_group, count(name) as cnt, something"); stmt.groupBy("something", "age_group");- 参数:
groupBy- groupBy expression
-
getGrouping
Object getGrouping()
Get X Protocol Expr objects for groupBy.- 返回:
- List of X Protocol Expr objects
-
setGroupingCriteria
void setGroupingCriteria(String having)
Parse having expressions into X Protocol Expr objects.SelectStatement stmt = table.select("age as age_group, count(name) as cnt, something"); stmt.groupBy("something", "age_group"); stmt.having("cnt > 1");- 参数:
having- having expression
-
getGroupingCriteria
Object getGroupingCriteria()
Get X Protocol Expr objects for grouping criteria.- 返回:
- List of X Protocol Expr objects
-
getLock
FilterParams.RowLock getLock()
GetFilterParams.RowLockvalue.
-
setLock
void setLock(FilterParams.RowLock rowLock)
SetFilterParams.RowLockvalue.- 参数:
rowLock-FilterParams.RowLock
-
getLockOption
FilterParams.RowLockOptions getLockOption()
GetFilterParams.RowLockOptionsvalue.
-
setLockOption
void setLockOption(FilterParams.RowLockOptions rowLockOption)
SetFilterParams.RowLockOptionsvalue.- 参数:
rowLockOption-FilterParams.RowLockOptions
-
-