Top Description Inners Methods
com.mysql.cj.xdevapi

public Interface FilterParams

Known Direct Implementers
com.mysql.cj.xdevapi.AbstractFilterParams
Imports
com.mysql.cj.exceptions.WrongArgumentException

Transforms X DevAPI filter parameters into X Protocol message entities. Used internally.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
FilterParams.RowLock

The type of row lock.

public static enum
FilterParams.RowLockOptions

Options that define the behavior while retrieving locked rows.

Method Summary

Modifier and TypeMethod and Description
public void
addArg(String
bind key
name
,
Object
bind value
value
)

Set binding.

public void
clearArgs()

Remove all current bindings.

public Object

Returns:

List of X Protocol Scalar object
getArgs
()

Get binding arguments.

public Object

Returns:

X Protocol Collection object
getCollection
()

Get X Protocol Collection object.

public Object

Returns:

X Protocol Expr object
getCriteria
()

Get the search criteria.

public Object

Returns:

List of X Protocol Projection objects.
getFields
()

Get X Protocol Projection objects.

public Object

Returns:

List of X Protocol Expr objects
getGrouping
()

Get X Protocol Expr objects for groupBy.

public Object

Returns:

List of X Protocol Expr objects
getGroupingCriteria
()

Get X Protocol Expr objects for grouping criteria.

public Long

Returns:

limit
getLimit
()

Get max number of rows to filter.

public FilterParams.RowLock

Returns:

RowLock
getLock
()

Get RowLock value.

public FilterParams.RowLockOptions
public Long

Returns:

maximum rows to skip
getOffset
()

Get number of rows to skip before finding others.

public Object

Returns:

List of X Protocol Order objects
getOrder
()

Get X Protocol Order objects.

public boolean

Returns:

true if allowed
isRelational
()

Are relational columns identifiers allowed?

public void
setCriteria(String
expression
criteriaString
)

Parse criteriaString into X Protocol Expr object.

public void
setFields(String...
projection expression
projection
)

Parse projection expressions into X Protocol Projection objects.

public void
setGrouping(String...
groupBy expression
groupBy
)

Parse groupBy expressions into X Protocol Expr objects.

public void
setGroupingCriteria(String
having expression
having
)

Parse having expressions into X Protocol Expr objects.

public void
setLimit(Long
maximum rows to find
limit
)

Set maximum rows to find.

public void
public void
public void
setOffset(Long
maximum rows to skip
offset
)

Set number of rows to skip before finding others.

public void
setOrder(String...
order expressions
orderExpression
)

Parse order expressions into X Protocol Order objects.

public boolean

Returns:

true if offset clause is supported
supportsOffset
()

Whether offset clause is supported in the statement or not.

public void
verifyAllArgsBound()

Verify that all arguments are bound.

Method Detail

addArgback to summary
public void addArg(String name, Object value)

Set binding.

this.collection.find("a = :arg1 or b = :arg2").bind("arg1", 1).bind("arg2", 2).execute();
Parameters
name:String

bind key

value:Object

bind value

clearArgsback to summary
public void clearArgs()

Remove all current bindings.

getArgsback to summary
public Object getArgs()

Get binding arguments.

Returns:Object

List of X Protocol Scalar object

getCollectionback to summary
public Object getCollection()

Get X Protocol Collection object.

Returns:Object

X Protocol Collection object

getCriteriaback to summary
public Object getCriteria()

Get the search criteria.

Returns:Object

X Protocol Expr object

getFieldsback to summary
public Object getFields()

Get X Protocol Projection objects.

Returns:Object

List of X Protocol Projection objects.

getGroupingback to summary
public Object getGrouping()

Get X Protocol Expr objects for groupBy.

Returns:Object

List of X Protocol Expr objects

getGroupingCriteriaback to summary
public Object getGroupingCriteria()

Get X Protocol Expr objects for grouping criteria.

Returns:Object

List of X Protocol Expr objects

getLimitback to summary
public Long getLimit()

Get max number of rows to filter.

Returns:Long

limit

getLockback to summary
public FilterParams.RowLock getLock()

Get RowLock value.

Returns:FilterParams.RowLock

RowLock

getLockOptionback to summary
public FilterParams.RowLockOptions getLockOption()

Get RowLockOptions value.

Returns:FilterParams.RowLockOptions

RowLockOptions

getOffsetback to summary
public Long getOffset()

Get number of rows to skip before finding others.

Returns:Long

maximum rows to skip

getOrderback to summary
public Object getOrder()

Get X Protocol Order objects.

Returns:Object

List of X Protocol Order objects

isRelationalback to summary
public boolean isRelational()

Are relational columns identifiers allowed?

Returns:boolean

true if allowed

setCriteriaback to summary
public 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();
Parameters
criteriaString:String

expression

setFieldsback to summary
public 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();
Parameters
projection:String[]

projection expression

setGroupingback to summary
public 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");
Parameters
groupBy:String[]

groupBy expression

setGroupingCriteriaback to summary
public 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");
Parameters
having:String

having expression

setLimitback to summary
public 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();
Parameters
limit:Long

maximum rows to find

setLockback to summary
public void setLock(FilterParams.RowLock rowLock)

Set RowLock value.

Parameters
rowLock:FilterParams.RowLock

RowLock

setLockOptionback to summary
public void setLockOption(FilterParams.RowLockOptions rowLockOption)

Set RowLockOptions value.

Parameters
rowLockOption:FilterParams.RowLockOptions

RowLockOptions

setOffsetback to summary
public 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();
Parameters
offset:Long

maximum rows to skip

setOrderback to summary
public 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();
Parameters
orderExpression:String[]

order expressions

supportsOffsetback to summary
public 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.

Returns:boolean

true if offset clause is supported

verifyAllArgsBoundback to summary
public void verifyAllArgsBound()

Verify that all arguments are bound. Throws WrongArgumentException if any placeholder argument is not bound.

com.mysql.cj.xdevapi back to summary

public final Enum FilterParams.RowLock

extends Enum<FilterParams.RowLock>
Class Inheritance

The type of row lock.

Field Summary

Modifier and TypeField and Description
public static final FilterParams.RowLock
EXCLUSIVE_LOCK

Lock matching rows so no other transactions can read or write to it.

private int
public static final FilterParams.RowLock
SHARED_LOCK

Lock matching rows against updates.

Constructor Summary

AccessConstructor and Description
private
RowLock(int rowLock)

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

row lock type id
asNumber
()

Get the row lock type id.

public static FilterParams.RowLock
public static FilterParams.RowLock[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

EXCLUSIVE_LOCKback to summary
public static final FilterParams.RowLock EXCLUSIVE_LOCK

Lock matching rows so no other transactions can read or write to it.

rowLockback to summary
private int rowLock
SHARED_LOCKback to summary
public static final FilterParams.RowLock SHARED_LOCK

Lock matching rows against updates.

Constructor Detail

RowLockback to summary
private RowLock(int rowLock)

Method Detail

asNumberback to summary
public int asNumber()

Get the row lock type id.

Returns:int

row lock type id

valueOfback to summary
public static FilterParams.RowLock valueOf(String name)
valuesback to summary
public static FilterParams.RowLock[] values()
com.mysql.cj.xdevapi back to summary

public final Enum FilterParams.RowLockOptions

extends Enum<FilterParams.RowLockOptions>
Class Inheritance

Options that define the behavior while retrieving locked rows.

Field Summary

Modifier and TypeField and Description
public static final FilterParams.RowLockOptions
NOWAIT

Do not wait to acquire row lock, fail with an error if a requested row is locked.

private int
public static final FilterParams.RowLockOptions
SKIP_LOCKED

Do not wait to acquire a row lock, remove locked rows from the result set.

Constructor Summary

AccessConstructor and Description
private
RowLockOptions(int rowLockOption)

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

row lock option id
asNumber
()

Get the row lock option id.

public static FilterParams.RowLockOptions
public static FilterParams.RowLockOptions[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

NOWAITback to summary
public static final FilterParams.RowLockOptions NOWAIT

Do not wait to acquire row lock, fail with an error if a requested row is locked.

rowLockOptionback to summary
private int rowLockOption
SKIP_LOCKEDback to summary
public static final FilterParams.RowLockOptions SKIP_LOCKED

Do not wait to acquire a row lock, remove locked rows from the result set.

Constructor Detail

RowLockOptionsback to summary
private RowLockOptions(int rowLockOption)

Method Detail

asNumberback to summary
public int asNumber()

Get the row lock option id.

Returns:int

row lock option id

valueOfback to summary
public static FilterParams.RowLockOptions valueOf(String name)
valuesback to summary
public static FilterParams.RowLockOptions[] values()