Class FindStatement<T>
Represents a chaining collection find statement.
Namespace: MySqlX.XDevAPI.CRUD
Assembly: MySql.Data.dll
Version: 9.1.0
Syntax
public class FindStatement<T> : FilterableStatement<FindStatement<T>, Collection<T>, DocResult<T>, T>
Type Parameters
Name | Description |
---|---|
T |
Methods
Execute()
Executes the Find statement.
Declaration
public override DocResult<T> Execute()
Returns
Type | Description |
---|---|
DocResult<T> | A DocResult<T> object containing the results of execution and data. |
Overrides
Fields(String[])
List of column projections that shall be returned.
Declaration
public FindStatement<T> Fields(params string[] columns)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | columns | List of columns. |
Returns
Type | Description |
---|---|
FindStatement<T> | This FindStatement<T> object set with the specified columns or fields. |
GroupBy(String[])
Sets the collection aggregation.
Declaration
public FindStatement<T> GroupBy(params string[] groupBy)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | groupBy | The field list for aggregation. |
Returns
Type | Description |
---|---|
FindStatement<T> | This same FindStatement<T> object set with the specified group-by criteria. |
Having(String)
Filters criteria for aggregated groups.
Declaration
public FindStatement<T> Having(string having)
Parameters
Type | Name | Description |
---|---|---|
System.String | having | The filter criteria for aggregated groups. |
Returns
Type | Description |
---|---|
FindStatement<T> | This same FindStatement<T> object set with the specified filter criteria. |
LockExclusive(LockContention)
Locks matching rows so no other transaction can read or write to it.
Declaration
public FindStatement<T> LockExclusive(LockContention lockOption = LockContention.Default)
Parameters
Type | Name | Description |
---|---|---|
LockContention | lockOption | Optional row lock option to use. |
Returns
Type | Description |
---|---|
FindStatement<T> | This same FindStatement<T> object set with the lock exclusive option. |
Exceptions
Type | Condition |
---|---|
MySqlException | The server version is lower than 8.0.3. |
LockShared(LockContention)
Locks matching rows against updates.
Declaration
public FindStatement<T> LockShared(LockContention lockOption = LockContention.Default)
Parameters
Type | Name | Description |
---|---|---|
LockContention | lockOption | Optional row lock option to use. |
Returns
Type | Description |
---|---|
FindStatement<T> | This same FindStatement<T> object set with the lock shared option. |
Exceptions
Type | Condition |
---|---|
MySqlException | The server version is lower than 8.0.3. |
Sort(String[])
Sets user-defined sorting criteria for the operation. The strings use normal SQL syntax like "order ASC" or "pages DESC, age ASC".
Declaration
public FindStatement<T> Sort(params string[] order)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | order | The order criteria. |
Returns
Type | Description |
---|---|
FindStatement<T> | This same FindStatement<T> object set with the specified order criteria. |
Where(String)
Enables the setting of Where condition for this operation.
Declaration
[Obsolete("Where(string condition) has been deprecated since version 8.0.17.")]
public FindStatement<T> Where(string condition)
Parameters
Type | Name | Description |
---|---|---|
System.String | condition | The Where condition. |
Returns
Type | Description |
---|---|
FindStatement<T> | This same FindStatement<T> object set with the specified condition criteria. |