com.mysql.cj.xdevapi

## Interface FilterParams

    public interface FilterParams

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

### Nested Class Summary

Nested Classes
`static class` `FilterParams.RowLock` The type of row lock.
`static class` `FilterParams.RowLockOptions` Options that define the behavior while retrieving locked rows.

### Method Summary

All Methods Instance Methods Abstract Methods
`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.

### Method Detail

#### getCollection

    Object getCollection()

Get X Protocol Collection object.

Returns:
  X Protocol Collection object

#### getOrder

    Object getOrder()

Get X Protocol Order objects.

Returns:
  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();

Parameters:
  `orderExpression` - order expressions

#### getLimit

    Long getLimit()

Get max number of rows to filter.

Returns:
  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();

Parameters:
  `limit` - maximum rows to find

#### getOffset

    Long getOffset()

Get number of rows to skip before finding others.

Returns:
  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();

Parameters:
  `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.

Returns:
  `true` if offset clause is supported

#### getCriteria

    Object getCriteria()

Get the search criteria.

Returns:
  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();

Parameters:
  `criteriaString` - expression

#### getArgs

    Object getArgs()

Get binding arguments.

Returns:
  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();

Parameters:
  `name` - bind key
  `value` - bind value

#### verifyAllArgsBound

    void verifyAllArgsBound()

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

#### clearArgs

    void clearArgs()

Remove all current bindings.

#### isRelational

    boolean isRelational()

Are relational columns identifiers allowed?

Returns:
  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();

Parameters:
  `projection` - projection expression

#### getFields

    Object getFields()

Get X Protocol Projection objects.

Returns:
  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");

Parameters:
  `groupBy` - groupBy expression

#### getGrouping

    Object getGrouping()

Get X Protocol Expr objects for groupBy.

Returns:
  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");

Parameters:
  `having` - having expression

#### getGroupingCriteria

    Object getGroupingCriteria()

Get X Protocol Expr objects for grouping criteria.

Returns:
  List of X Protocol Expr objects

#### getLock

    FilterParams.RowLock getLock()

Get `FilterParams.RowLock` value.

Returns:
  `FilterParams.RowLock`

#### setLock

    void setLock(FilterParams.RowLock rowLock)

Set `FilterParams.RowLock` value.

Parameters:
  `rowLock` - `FilterParams.RowLock`

#### getLockOption

    FilterParams.RowLockOptions getLockOption()

Get `FilterParams.RowLockOptions` value.

Returns:
  `FilterParams.RowLockOptions`

#### setLockOption

    void setLockOption(FilterParams.RowLockOptions rowLockOption)

Set `FilterParams.RowLockOptions` value.

Parameters:
  `rowLockOption` - `FilterParams.RowLockOptions`

Copyright © 2016, 2022, Oracle and/or its affiliates.