java.lang.Object
org.jooq.tools.jdbc.MockExecuteContext
A mock execution context.
This context is passed to
MockDataProvider.execute(MockExecuteContext)
, as a context object
containing all relevant information about a given query execution.
- Author:
- Lukas Eder
- See Also:
-
Constructor Summary
ConstructorDescriptionMockExecuteContext
(String[] sql, Object[][] bindings) Create a new mock execution context.MockExecuteContext
(String[] sql, Object[][] bindings, int autoGeneratedKeys) Create a new mock execution context.MockExecuteContext
(String[] sql, Object[][] bindings, int[] columnIndexes) Create a new mock execution context.MockExecuteContext
(String[] sql, Object[][] bindings, String[] columnNames) Create a new mock execution context. -
Method Summary
Modifier and TypeMethodDescriptionint
The corresponding value fromMockStatement
.boolean
batch()
Whether this execution context is a from a batch statement.Object[][]
Get all bind variables of a "single batch" statement.boolean
Whether this execution context is from a "multi batch" statement.boolean
Whether this execution context is from a "single batch" statement.String[]
batchSQL()
Get all batch SQL statements of a "multi batch" statement.Object[]
bindings()
Get the single (or first "single batch") set of bind variables.int[]
The corresponding value fromMockStatement
.String[]
The corresponding value fromMockStatement
.int[]
Get the types of registered out parameters, if any.sql()
Get the single (or first "multi batch") SQL statement.
-
Constructor Details
-
MockExecuteContext
Create a new mock execution context.- Parameters:
sql
- The SQL statement(s)bindings
- The bind variable(s)
-
MockExecuteContext
Create a new mock execution context.- Parameters:
sql
- The SQL statement(s)bindings
- The bind variable(s)autoGeneratedKeys
- The corresponding value fromMockStatement
-
MockExecuteContext
Create a new mock execution context.- Parameters:
sql
- The SQL statement(s)bindings
- The bind variable(s)columnIndexes
- The corresponding value fromMockStatement
-
MockExecuteContext
Create a new mock execution context.- Parameters:
sql
- The SQL statement(s)bindings
- The bind variable(s)columnNames
- The corresponding value fromMockStatement
-
-
Method Details
-
batch
public boolean batch()Whether this execution context is a from a batch statement.- Returns:
- Whether this execution context is a from a batch statement.
-
batchSingle
public boolean batchSingle()Whether this execution context is from a "single batch" statement.- Returns:
- Whether this execution context is from a "single batch" statement.
- See Also:
-
batchMultiple
public boolean batchMultiple()Whether this execution context is from a "multi batch" statement.- Returns:
- Whether this execution context is from a "multi batch" statement.
- See Also:
-
batchSQL
Get all batch SQL statements of a "multi batch" statement.- Returns:
- All batch SQL statements of a "multi batch" statement, or an
array of length
1
with the single statement.
-
batchBindings
Get all bind variables of a "single batch" statement.- Returns:
- All bind variables of a "single batch" statment, or an array of
length
1
with the bind variables of a single statement.
-
sql
Get the single (or first "multi batch") SQL statement.- Returns:
- The single (or first "multi batch") SQL statement.
-
bindings
Get the single (or first "single batch") set of bind variables.- Returns:
- The single (or first "single batch") set of bind variables.
-
autoGeneratedKeys
public int autoGeneratedKeys()The corresponding value fromMockStatement
.- Returns:
- The corresponding value from
MockStatement
.
-
columnIndexes
public int[] columnIndexes()The corresponding value fromMockStatement
.- Returns:
- The corresponding value from
MockStatement
.
-
columnNames
The corresponding value fromMockStatement
.- Returns:
- The corresponding value from
MockStatement
.
-
outParameterTypes
public int[] outParameterTypes()Get the types of registered out parameters, if any.- Returns:
- the types of registered out parameters, if any.
-