com.mysql.cj.xdevapi

## Interface FindStatement

All Superinterfaces:
  Statement<FindStatement,DocResult>

    public interface FindStatement
    extends Statement<FindStatement,DocResult>

A statement to find the set of documents according to the given specification.

### Nested Class Summary

### Nested classes/interfaces inherited from interface com.mysql.cj.xdevapi.Statement

`Statement.LockContention`

### Method Summary

All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
`FindStatement` `fields(Expression docProjection)` Add/replace the field projection defining the result.
`FindStatement` `fields(String... projections)` Add/replace the field projections defining the result.
`FindStatement` `groupBy(String... groupBy)` Add/replace the aggregation fields for this query.
`FindStatement` `having(String having)` Add/replace the aggregate criteria for this query.
`FindStatement` `limit(long numberOfRows)` Add/replace the document limit for this query.
`FindStatement` `lockExclusive()` Locks matching rows exclusively so no other transactions can read or write to them.
`FindStatement` `lockExclusive(Statement.LockContention lockContention)` Locks matching rows exclusively so no other transactions can read or write to them, using the provided lock contention option.
`FindStatement` `lockShared()` Locks matching rows against updates.
`FindStatement` `lockShared(Statement.LockContention lockContention)` Locks matching rows against updates using the provided lock contention option.
`FindStatement` `offset(long limitOffset)` Add/replace the document offset for this query.
`FindStatement` `orderBy(String... sortFields)` Add/replace the order specification for this query.
`default FindStatement` `skip(long limitOffset)` Deprecated. Deprecated in c/J 8.0.12, please use `offset(long)` instead.
`FindStatement` `sort(String... sortFields)` Add/replace the order specification for this query.

### Methods inherited from interface com.mysql.cj.xdevapi.Statement

`bind, bind, bind, bind, clearBindings, execute, executeAsync`

### Method Detail

#### fields

    FindStatement fields(String... projections)

Add/replace the field projections defining the result.

Parameters:
  `projections` - projection expression
Returns:
  `FindStatement`

#### fields

    FindStatement fields(Expression docProjection)

Add/replace the field projection defining the result.

Parameters:
  `docProjection` - projection expression
Returns:
  `FindStatement`

#### groupBy

    FindStatement groupBy(String... groupBy)

Add/replace the aggregation fields for this query.

Parameters:
  `groupBy` - groupBy expression
Returns:
  `FindStatement`

#### having

    FindStatement having(String having)

Add/replace the aggregate criteria for this query.

Parameters:
  `having` - having expression
Returns:
  `FindStatement`

#### orderBy

    FindStatement orderBy(String... sortFields)

Add/replace the order specification for this query.

Parameters:
  `sortFields` - sort expression
Returns:
  `FindStatement`

#### sort

    FindStatement sort(String... sortFields)

Add/replace the order specification for this query.

Synonym for `orderBy(String...)`

Parameters:
  `sortFields` - sort expression
Returns:
  `FindStatement`

#### skip

    @Deprecated
    default FindStatement skip(long limitOffset)

Deprecated. Deprecated in c/J 8.0.12, please use `offset(long)` instead.
Add/replace the document offset for this query.

Parameters:
  `limitOffset` - number of documents to skip
Returns:
  `FindStatement`

#### offset

    FindStatement offset(long limitOffset)

Add/replace the document offset for this query.

Parameters:
  `limitOffset` - number of documents to skip
Returns:
  `FindStatement`

#### limit

    FindStatement limit(long numberOfRows)

Add/replace the document limit for this query.

Parameters:
  `numberOfRows` - limit
Returns:
  `FindStatement`

#### lockShared

    FindStatement lockShared()

Locks matching rows against updates.

Returns:
  `FindStatement`

#### lockShared

    FindStatement lockShared(Statement.LockContention lockContention)

Locks matching rows against updates using the provided lock contention option.

Parameters:
  `lockContention` - The `Statement.LockContention` value to set.
Returns:
  `FindStatement`

#### lockExclusive

    FindStatement lockExclusive()

Locks matching rows exclusively so no other transactions can read or write to them.

Returns:
  `FindStatement`

#### lockExclusive

    FindStatement lockExclusive(Statement.LockContention lockContention)

Locks matching rows exclusively so no other transactions can read or write to them, using the provided lock contention option.

Parameters:
  `lockContention` - The `Statement.LockContention` value to set.
Returns:
  `FindStatement`

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