public class MockResult extends Object
This type is used to wrap unified results of DDL and DML query executions. JDBC execution results can be summarised to two properties:
Statement.getUpdateCount(): The number of affected rowsStatement.getResultSet(): The result set
See MockDataProvider.execute(MockExecuteContext) for more details
MockDataProvider| Modifier and Type | Field and Description |
|---|---|
Result<?> |
data
The result data associated with this execution result.
|
int |
rows
The number of affected rows for this execution result.
|
| Constructor and Description |
|---|
MockResult()
Create a new
MockResult. |
MockResult(int rows)
Create a new
MockResult. |
MockResult(int rows,
Result<?> data)
Create a new
MockResult. |
MockResult(Record data)
Create a new
MockResult. |
public final int rows
This number corresponds to the value of
Statement.getUpdateCount(). The following values are possible:
public final Result<?> data
This object describes the result data (including meta data).
If the given query execution did not provide any results (as in
), this may be
Statement.execute(String) == falsenull. This is not the same as producing an empty
result, which can only be modelled by an empty Result, containing
column information but no rows.
Statement.getGeneratedKeys()public MockResult()
MockResult.
This is a convenience constructor calling
MockResult(-1, null).
MockDataProvider for detailspublic MockResult(int rows)
MockResult.
This is a convenience constructor calling
MockResult(rows, null).
MockDataProvider for detailspublic MockResult(Record data)
MockResult.
This is a convenience constructor creating a MockResult with
exactly one record.
data - The single record in this result. Record instances can be
obtained from queries, instantiated from generated record
classes, or created using
DSLContext.newRecord(org.jooq.Field...) and other
overloads.MockDataProvider for detailspublic MockResult(int rows,
Result<?> data)
MockResult.rows - The number of affected rowsdata - The result data. Result instances can be obtained from
queries, or created using
DSLContext.newResult(org.jooq.Field...) and other
overloads.MockDataProvider for detailsCopyright © 2019. All rights reserved.