类 AbstractFilterParams
- java.lang.Object
-
- com.mysql.cj.xdevapi.AbstractFilterParams
-
- 所有已实现的接口:
FilterParams
- 直接已知子类:
DocFilterParams,TableFilterParams
public abstract class AbstractFilterParams extends Object implements FilterParams
Abstract implementation ofFilterParams.
-
-
嵌套类概要
-
从接口继承的嵌套类/接口 com.mysql.cj.xdevapi.FilterParams
FilterParams.RowLock, FilterParams.RowLockOptions
-
-
字段概要
字段 修饰符和类型 字段 说明 protected MysqlxDatatypes.Scalar[]argsprotected MysqlxCrud.Collectioncollectionprotected StringcriteriaStrprotected List<MysqlxCrud.Projection>fieldsprotected String[]groupByprotected booleanisRelationalprotected Longlimitprotected FilterParams.RowLocklockprotected FilterParams.RowLockOptionslockOptionprotected Longoffsetprotected String[]orderExprprotected String[]projectionprotected booleansupportsOffset
-
构造器概要
构造器 构造器 说明 AbstractFilterParams(String schemaName, String collectionName, boolean supportsOffset, boolean isRelational)Constructor.
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 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.abstract 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 lockOption)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.
-
-
-
字段详细资料
-
collection
protected MysqlxCrud.Collection collection
-
limit
protected Long limit
-
offset
protected Long offset
-
supportsOffset
protected boolean supportsOffset
-
orderExpr
protected String[] orderExpr
-
criteriaStr
protected String criteriaStr
-
args
protected MysqlxDatatypes.Scalar[] args
-
isRelational
protected boolean isRelational
-
groupBy
protected String[] groupBy
-
projection
protected String[] projection
-
fields
protected List<MysqlxCrud.Projection> fields
-
lock
protected FilterParams.RowLock lock
-
lockOption
protected FilterParams.RowLockOptions lockOption
-
-
构造器详细资料
-
AbstractFilterParams
public AbstractFilterParams(String schemaName, String collectionName, boolean supportsOffset, boolean isRelational)
Constructor.- 参数:
schemaName- Schema namecollectionName- Collection namesupportsOffset- Whether offset is supported or notisRelational- Are relational columns identifiers allowed?
-
-
方法详细资料
-
getCollection
public Object getCollection()
从接口复制的说明:FilterParamsGet X Protocol Collection object.- 指定者:
getCollection在接口中FilterParams- 返回:
- X Protocol Collection object
-
getOrder
public Object getOrder()
从接口复制的说明:FilterParamsGet X Protocol Order objects.- 指定者:
getOrder在接口中FilterParams- 返回:
- List of X Protocol Order objects
-
setOrder
public void setOrder(String... orderExpression)
从接口复制的说明:FilterParamsParse order expressions into X Protocol Order objects.DocResult docs = this.collection.find().orderBy("$._id").execute(); docs = this.collection.find().sort("$.x", "$.y").execute();- 指定者:
setOrder在接口中FilterParams- 参数:
orderExpression- order expressions
-
getLimit
public Long getLimit()
从接口复制的说明:FilterParamsGet max number of rows to filter.- 指定者:
getLimit在接口中FilterParams- 返回:
- limit
-
setLimit
public void setLimit(Long limit)
从接口复制的说明:FilterParamsSet maximum rows to find.For example, to find the 3 first rows:
docs = this.collection.find().orderBy("$._id").limit(3).execute();- 指定者:
setLimit在接口中FilterParams- 参数:
limit- maximum rows to find
-
getOffset
public Long getOffset()
从接口复制的说明:FilterParamsGet number of rows to skip before finding others.- 指定者:
getOffset在接口中FilterParams- 返回:
- maximum rows to skip
-
setOffset
public void setOffset(Long offset)
从接口复制的说明:FilterParamsSet 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();- 指定者:
setOffset在接口中FilterParams- 参数:
offset- maximum rows to skip
-
supportsOffset
public boolean supportsOffset()
从接口复制的说明:FilterParamsWhether offset clause is supported in the statement or not.Note that setting offset values is always possible, even if they are not supported.
- 指定者:
supportsOffset在接口中FilterParams- 返回:
trueif offset clause is supported
-
getCriteria
public Object getCriteria()
从接口复制的说明:FilterParamsGet the search criteria.- 指定者:
getCriteria在接口中FilterParams- 返回:
- X Protocol Expr object
-
setCriteria
public void setCriteria(String criteriaString)
从接口复制的说明:FilterParamsParse criteriaString into X Protocol Expr object.docs = this.collection.find("$.x1 = 29 | 15").execute(); table.delete().where("age == 13").execute();- 指定者:
setCriteria在接口中FilterParams- 参数:
criteriaString- expression
-
getArgs
public Object getArgs()
从接口复制的说明:FilterParamsGet binding arguments.- 指定者:
getArgs在接口中FilterParams- 返回:
- List of X Protocol Scalar object
-
addArg
public void addArg(String name, Object value)
从接口复制的说明:FilterParamsSet binding.this.collection.find("a = :arg1 or b = :arg2").bind("arg1", 1).bind("arg2", 2).execute();- 指定者:
addArg在接口中FilterParams- 参数:
name- bind keyvalue- bind value
-
verifyAllArgsBound
public void verifyAllArgsBound()
从接口复制的说明:FilterParamsVerify that all arguments are bound. ThrowsWrongArgumentExceptionif any placeholder argument is not bound.- 指定者:
verifyAllArgsBound在接口中FilterParams
-
clearArgs
public void clearArgs()
从接口复制的说明:FilterParamsRemove all current bindings.- 指定者:
clearArgs在接口中FilterParams
-
isRelational
public boolean isRelational()
从接口复制的说明:FilterParamsAre relational columns identifiers allowed?- 指定者:
isRelational在接口中FilterParams- 返回:
- true if allowed
-
setFields
public abstract void setFields(String... projection)
从接口复制的说明:FilterParamsParse 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();- 指定者:
setFields在接口中FilterParams- 参数:
projection- projection expression
-
getFields
public Object getFields()
从接口复制的说明:FilterParamsGet X Protocol Projection objects.- 指定者:
getFields在接口中FilterParams- 返回:
- List of X Protocol Projection objects.
-
setGrouping
public void setGrouping(String... groupBy)
从接口复制的说明:FilterParamsParse 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");- 指定者:
setGrouping在接口中FilterParams- 参数:
groupBy- groupBy expression
-
getGrouping
public Object getGrouping()
从接口复制的说明:FilterParamsGet X Protocol Expr objects for groupBy.- 指定者:
getGrouping在接口中FilterParams- 返回:
- List of X Protocol Expr objects
-
setGroupingCriteria
public void setGroupingCriteria(String having)
从接口复制的说明:FilterParamsParse 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");- 指定者:
setGroupingCriteria在接口中FilterParams- 参数:
having- having expression
-
getGroupingCriteria
public Object getGroupingCriteria()
从接口复制的说明:FilterParamsGet X Protocol Expr objects for grouping criteria.- 指定者:
getGroupingCriteria在接口中FilterParams- 返回:
- List of X Protocol Expr objects
-
getLock
public FilterParams.RowLock getLock()
从接口复制的说明:FilterParamsGetFilterParams.RowLockvalue.- 指定者:
getLock在接口中FilterParams- 返回:
FilterParams.RowLock
-
setLock
public void setLock(FilterParams.RowLock rowLock)
从接口复制的说明:FilterParamsSetFilterParams.RowLockvalue.- 指定者:
setLock在接口中FilterParams- 参数:
rowLock-FilterParams.RowLock
-
getLockOption
public FilterParams.RowLockOptions getLockOption()
从接口复制的说明:FilterParamsGetFilterParams.RowLockOptionsvalue.- 指定者:
getLockOption在接口中FilterParams- 返回:
FilterParams.RowLockOptions
-
setLockOption
public void setLockOption(FilterParams.RowLockOptions lockOption)
从接口复制的说明:FilterParamsSetFilterParams.RowLockOptionsvalue.- 指定者:
setLockOption在接口中FilterParams- 参数:
lockOption-FilterParams.RowLockOptions
-
-