public interface FilterParams
Modifier and Type | Interface and Description |
---|---|
static class |
FilterParams.RowLock
The type of row lock.
|
static class |
FilterParams.RowLockOptions
Options that define the behavior while retrieving locked rows.
|
Modifier and Type | Method and Description |
---|---|
void |
addArg(String name,
Object value)
Set binding.
|
void |
clearArgs()
Remove all current bindings.
|
Object |
getArgs()
Get binding arguments.
|
Object |
getCollection()
Get X Protocol Collection object.
|
Object |
getCriteria()
Get the search criteria.
|
Object |
getFields()
Get X Protocol Projection objects.
|
Object |
getGrouping()
Get X Protocol Expr objects for groupBy.
|
Object |
getGroupingCriteria()
Get X Protocol Expr objects for grouping criteria.
|
Long |
getLimit()
Get max number of rows to filter.
|
FilterParams.RowLock |
getLock()
Get
FilterParams.RowLock value. |
FilterParams.RowLockOptions |
getLockOption()
Get
FilterParams.RowLockOptions value. |
Long |
getOffset()
Get number of rows to skip before finding others.
|
Object |
getOrder()
Get X Protocol Order objects.
|
boolean |
isRelational()
Are relational columns identifiers allowed?
|
void |
setCriteria(String criteriaString)
Parse criteriaString into X Protocol Expr object.
|
void |
setFields(String... projection)
Parse projection expressions into X Protocol Projection objects.
|
void |
setGrouping(String... groupBy)
Parse groupBy expressions into X Protocol Expr objects.
|
void |
setGroupingCriteria(String having)
Parse having expressions into X Protocol Expr objects.
|
void |
setLimit(Long limit)
Set maximum rows to find.
|
void |
setLock(FilterParams.RowLock rowLock)
Set
FilterParams.RowLock value. |
void |
setLockOption(FilterParams.RowLockOptions rowLockOption)
Set
FilterParams.RowLockOptions value. |
void |
setOffset(Long offset)
Set number of rows to skip before finding others.
|
void |
setOrder(String... orderExpression)
Parse order expressions into X Protocol Order objects.
|
boolean |
supportsOffset()
Whether offset clause is supported in the statement or not.
|
void |
verifyAllArgsBound()
Verify that all arguments are bound.
|
Object getCollection()
Object getOrder()
void setOrder(String... orderExpression)
DocResult docs = this.collection.find().orderBy("$._id").execute(); docs = this.collection.find().sort("$.x", "$.y").execute();
orderExpression
- order expressionsLong getLimit()
void setLimit(Long limit)
For example, to find the 3 first rows:
docs = this.collection.find().orderBy("$._id").limit(3).execute();
limit
- maximum rows to findLong getOffset()
void setOffset(Long offset)
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 skipboolean supportsOffset()
Note that setting offset values is always possible, even if they are not supported.
true
if offset clause is supportedObject getCriteria()
void setCriteria(String criteriaString)
docs = this.collection.find("$.x1 = 29 | 15").execute(); table.delete().where("age == 13").execute();
criteriaString
- expressionObject getArgs()
void addArg(String name, Object value)
this.collection.find("a = :arg1 or b = :arg2").bind("arg1", 1).bind("arg2", 2).execute();
name
- bind keyvalue
- bind valuevoid verifyAllArgsBound()
WrongArgumentException
if any placeholder argument is not bound.void clearArgs()
boolean isRelational()
void setFields(String... projection)
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 expressionObject getFields()
void setGrouping(String... groupBy)
SelectStatement stmt = table.select("age as age_group, count(name) as cnt, something"); stmt.groupBy("something", "age_group");
groupBy
- groupBy expressionObject getGrouping()
void setGroupingCriteria(String having)
SelectStatement stmt = table.select("age as age_group, count(name) as cnt, something"); stmt.groupBy("something", "age_group"); stmt.having("cnt > 1");
having
- having expressionObject getGroupingCriteria()
FilterParams.RowLock getLock()
FilterParams.RowLock
value.FilterParams.RowLock
void setLock(FilterParams.RowLock rowLock)
FilterParams.RowLock
value.rowLock
- FilterParams.RowLock
FilterParams.RowLockOptions getLockOption()
FilterParams.RowLockOptions
value.FilterParams.RowLockOptions
void setLockOption(FilterParams.RowLockOptions rowLockOption)
FilterParams.RowLockOptions
value.rowLockOption
- FilterParams.RowLockOptions