public abstract class AbstractParameterResultSetHandler extends AbstractResultSetHandler
PreparedStatement
and CallableStatement.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
exactMatchParameter |
| Constructor and Description |
|---|
AbstractParameterResultSetHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
addParameterMapForExecutedStatement(String sql,
MockParameterMap parameters)
Collects all SQL strings that were executed.
|
Map<String,ParameterSets> |
getExecutedStatementParameter()
Deprecated.
|
Map<String,ParameterSets> |
getExecutedStatementParameterMap()
Returns the
Map of executed SQL strings. |
MockResultSet |
getGeneratedKeys(String sql,
MockParameterMap parameters)
Returns the first generated keys
ResultSet that
matches the specified SQL string. |
ParameterSets |
getParametersForExecutedStatement(String sql)
Returns the
ParameterSets for a specified
SQL string. |
MockResultSet |
getResultSet(String sql,
MockParameterMap parameters)
Returns the first
ResultSet that matches the
specified SQL string and the specified parameters. |
MockResultSet[] |
getResultSets(String sql,
MockParameterMap parameters)
Returns the first
ResultSet[] that matches the
specified SQL string and the specified parameters. |
SQLException |
getSQLException(String sql,
MockParameterMap parameters)
Returns the
SQLException the specified SQL string
should throw. |
boolean |
getThrowsSQLException(String sql,
MockParameterMap parameters)
Returns if the specified SQL string with the specified parameters
should raise an exception.
|
Integer |
getUpdateCount(String sql,
MockParameterMap parameters)
Returns the first update count that matches the
specified SQL string and the specified parameters.
|
Integer[] |
getUpdateCounts(String sql,
MockParameterMap parameters)
Returns the first update count array that matches the
specified SQL string and the specified parameters.
|
boolean |
hasMultipleResultSets(String sql,
MockParameterMap parameters)
Returns the if the specified SQL string with the specified parameters
returns multiple result sets.
|
boolean |
hasMultipleUpdateCounts(String sql,
MockParameterMap parameters)
Returns the if the specified SQL string with the specified parameters
returns multiple update counts.
|
void |
prepareGeneratedKeys(String sql,
MockResultSet generatedKeysResult)
Prepare the generated keys
ResultSet
for a specified SQL string with an empty parameter map. |
void |
prepareGeneratedKeys(String sql,
MockResultSet generatedKeysResult,
List<Object> parameters)
Prepare the generated keys
ResultSet
for a specified SQL string. |
void |
prepareGeneratedKeys(String sql,
MockResultSet generatedKeysResult,
MockParameterMap parameters)
Prepare the generated keys
ResultSet
for a specified SQL string. |
void |
prepareGeneratedKeys(String sql,
MockResultSet generatedKeysResult,
Object[] parameters)
Prepare the generated keys
ResultSet
for a specified SQL string. |
void |
prepareResultSet(String sql,
MockResultSet resultSet)
Prepare a
ResultSet for a specified SQL string and
an empty parameter map. |
void |
prepareResultSet(String sql,
MockResultSet resultSet,
List<Object> parameters)
Prepare a
ResultSet for a specified SQL string and
the specified parameters. |
void |
prepareResultSet(String sql,
MockResultSet resultSet,
MockParameterMap parameters)
Prepare a
ResultSet for a specified SQL string and
the specified parameters. |
void |
prepareResultSet(String sql,
MockResultSet resultSet,
Object[] parameters)
Prepare a
ResultSet for a specified SQL string and
the specified parameters. |
void |
prepareResultSets(String sql,
MockResultSet[] resultSets)
Prepare an array of
ResultSet objects for a specified SQL string and
an empty parameter map. |
void |
prepareResultSets(String sql,
MockResultSet[] resultSets,
List<Object> parameters)
Prepare an array of
ResultSet objects for a specified SQL string and
the specified parameters. |
void |
prepareResultSets(String sql,
MockResultSet[] resultSets,
MockParameterMap parameters)
Prepare an array of
ResultSet objects for a specified SQL string and
the specified parameters. |
void |
prepareResultSets(String sql,
MockResultSet[] resultSets,
Object[] parameters)
Prepare an array of
ResultSet objects for a specified SQL string and
the specified parameters. |
void |
prepareThrowsSQLException(String sql)
Prepare that the specified SQL string with empty parameters
should raise an exception.
|
void |
prepareThrowsSQLException(String sql,
List<Object> parameters)
Prepare that the specified SQL string with the specified parameters
should raise an exception.
|
void |
prepareThrowsSQLException(String sql,
MockParameterMap parameters)
Prepare that the specified SQL string with the specified parameters
should raise an exception.
|
void |
prepareThrowsSQLException(String sql,
Object[] parameters)
Prepare that the specified SQL string with the specified parameters
should raise an exception.
|
void |
prepareThrowsSQLException(String sql,
SQLException exc)
Prepare that the specified SQL string with empty parameters
should raise an exception.
|
void |
prepareThrowsSQLException(String sql,
SQLException exc,
List<Object> parameters)
Prepare that the specified SQL string with the specified parameters
should raise an exception.
|
void |
prepareThrowsSQLException(String sql,
SQLException exc,
MockParameterMap parameters)
Prepare that the specified SQL string with the specified parameters
should raise an exception.
|
void |
prepareThrowsSQLException(String sql,
SQLException exc,
Object[] parameters)
Prepare that the specified SQL string with the specified parameters
should raise an exception.
|
void |
prepareUpdateCount(String sql,
int updateCount)
Prepare the update count for execute update calls for a specified SQL string
with an empty parameter map.
|
void |
prepareUpdateCount(String sql,
int updateCount,
List<Object> parameters)
Prepare the update count for execute update calls for a specified SQL string
and the specified parameters.
|
void |
prepareUpdateCount(String sql,
int updateCount,
MockParameterMap parameters)
Prepare the update count for execute update calls for a specified SQL string
and the specified parameters.
|
void |
prepareUpdateCount(String sql,
int updateCount,
Object[] parameters)
Prepare the update count for execute update calls for a specified SQL string
and the specified parameters.
|
void |
prepareUpdateCounts(String sql,
Integer[] updateCounts)
Prepare the update counts for execute update calls for a specified SQL string
with an empty parameter map.
|
void |
prepareUpdateCounts(String sql,
Integer[] updateCounts,
List<Object> parameters)
Prepare an array update count values for execute update calls for a specified SQL string
and the specified parameters.
|
void |
prepareUpdateCounts(String sql,
Integer[] updateCounts,
MockParameterMap parameters)
Prepare an array update count values for execute update calls for a specified SQL string
and the specified parameters.
|
void |
prepareUpdateCounts(String sql,
Integer[] updateCounts,
Object[] parameters)
Prepare an array update count values for execute update calls for a specified SQL string
and the specified parameters.
|
void |
removeGeneratedKeys(String sql,
MockParameterMap parameters)
Remove the generated keys mock for the specified SQL string.
|
void |
removeResultSet(String sql,
MockParameterMap parameters)
Given a SQL string, remove the associated entry from the resultSetsForStatement TreeMap
|
void |
removeThrowsSqlException(String sql,
MockParameterMap parameters)
Remove the throws mock for the specified SQL string.
|
void |
removeUpdateCount(String sql,
MockParameterMap parameters)
Remove the update count mock for the specified SQL string.
|
void |
setExactMatchParameter(boolean exactMatchParameter)
Sets if the specified parameters must match exactly
in order and number.
|
addExecutedStatement, addReturnedResultSet, addReturnedResultSets, clearGeneratedKeys, clearGlobalGeneratedKeys, clearGlobalResultSet, clearGlobalUpdateCount, clearResultSets, clearReturnsResultSet, clearThrowsSQLException, clearUpdateCounts, createResultSet, createResultSet, createResultSet, createResultSet, getCaseSensitive, getContinueProcessingOnBatchFailure, getExactMatch, getExecutedStatements, getGeneratedKeys, getGeneratedKeys, getGlobalGeneratedKeys, getGlobalResultSet, getGlobalResultSets, getGlobalUpdateCount, getGlobalUpdateCounts, getListFromMapForSQLStatement, getMatchingObjects, getMatchingParameterWrapper, getPatternMatcherFactory, getResultSet, getResultSet, getResultSetFactory, getResultSets, getResultSets, getReturnedResultSets, getReturnsResultSet, getSQLException, getSQLException, getThrowsSQLException, getUpdateCount, getUpdateCount, getUpdateCounts, getUpdateCounts, getUseRegularExpressions, hasMultipleGlobalResultSets, hasMultipleGlobalUpdateCounts, hasMultipleResultSets, hasMultipleResultSets, hasMultipleUpdateCounts, hasMultipleUpdateCounts, onPatternMatcherFactoryChanged, prepareGlobalGeneratedKeys, prepareGlobalResultSet, prepareGlobalResultSets, prepareGlobalUpdateCount, prepareGlobalUpdateCounts, prepareReturnsResultSet, recompile, removeAllGeneratedKeys, removeAllResultSet, removeAllThrowsSqlException, removeAllUpdateCount, removeGeneratedKeys, removeGeneratedKeys, removeMatchingParameterWrapper, removeResultSet, removeResultSet, removeThrowsSqlException, removeThrowsSqlException, removeUpdateCount, removeUpdateCount, resetPatternMatcherFactory, setCaseSensitive, setContinueProcessingOnBatchFailure, setExactMatch, setPatternMatcherFactory, setResultSetFactory, setUseRegularExpressionspublic void addParameterMapForExecutedStatement(String sql, MockParameterMap parameters)
sql - the SQL stringparameters - a copy of the corresponding parameter mappublic ParameterSets getParametersForExecutedStatement(String sql)
ParameterSets for a specified
SQL string.sql - the SQL stringMap of parameterspublic Map<String,ParameterSets> getExecutedStatementParameterMap()
Map of executed SQL strings.
Each string maps to the corresponding ParameterSets
object.Map of parameters@Deprecated public Map<String,ParameterSets> getExecutedStatementParameter()
getExecutedStatementParameterMap()public void setExactMatchParameter(boolean exactMatchParameter)
false, i.e. the specified
parameters must be present in the actual parameter
list of the prepared statement with the correct index
but it's ok if there are more actual parameters.exactMatchParameter - must parameters match exactlypublic Integer getUpdateCount(String sql, MockParameterMap parameters)
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).sql - the SQL stringparameters - the parameterspublic Integer[] getUpdateCounts(String sql, MockParameterMap parameters)
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).sql - the SQL stringparameters - the parameterspublic boolean hasMultipleUpdateCounts(String sql, MockParameterMap parameters)
AbstractResultSetHandler.setCaseSensitive(boolean),
AbstractResultSetHandler.setExactMatch(boolean) and AbstractResultSetHandler.setUseRegularExpressions(boolean).sql - the SQL stringtrue if the SQL string returns multiple update counts,
false otherwisepublic MockResultSet getResultSet(String sql, MockParameterMap parameters)
ResultSet that matches the
specified SQL string and the specified parameters.
If the specified SQL string was prepared to return multiple result
sets, the first one will be returned.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).sql - the SQL stringparameters - the parametersMockResultSetpublic MockResultSet[] getResultSets(String sql, MockParameterMap parameters)
ResultSet[] that matches the
specified SQL string and the specified parameters.
If the specified SQL string was prepared to return one single
ResultSet, this ResultSet will be wrapped
in an array with one element.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).sql - the SQL stringparameters - the parameterspublic boolean hasMultipleResultSets(String sql, MockParameterMap parameters)
AbstractResultSetHandler.setCaseSensitive(boolean),
AbstractResultSetHandler.setExactMatch(boolean) and AbstractResultSetHandler.setUseRegularExpressions(boolean).sql - the SQL stringtrue if the SQL string returns multiple update counts,
false otherwisepublic boolean getThrowsSQLException(String sql, MockParameterMap parameters)
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).sql - the SQL stringparameters - the parameterstrue if the specified SQL string should raise an exception,
false otherwisepublic SQLException getSQLException(String sql, MockParameterMap parameters)
SQLException the specified SQL string
should throw. Returns null if the specified SQL string
should not throw an exception.
This can be used to simulate database exceptions.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).sql - the SQL stringparameters - the parametersSQLException or nullpublic MockResultSet getGeneratedKeys(String sql, MockParameterMap parameters)
ResultSet that
matches the specified SQL string.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).sql - the SQL stringparameters - the parametersMockResultSetpublic void prepareResultSet(String sql, MockResultSet resultSet)
ResultSet for a specified SQL string and
an empty parameter map.prepareResultSet in class AbstractResultSetHandlersql - the SQL stringresultSet - the corresponding MockResultSetpublic void prepareResultSets(String sql, MockResultSet[] resultSets)
ResultSet objects for a specified SQL string and
an empty parameter map.prepareResultSets in class AbstractResultSetHandlersql - the SQL stringresultSets - the corresponding MockResultSet[]public void prepareResultSet(String sql, MockResultSet resultSet, Object[] parameters)
ResultSet for a specified SQL string and
the specified parameters. The specified parameters array
must contain the parameters in the correct order starting with index 0 for
the first parameter. Please keep in mind that parameters in
PreparedStatement objects start with 1 as the first
parameter. So parameters[0] maps to the
parameter with index 1.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).sql - the SQL stringresultSet - the corresponding MockResultSetparameters - the parameterspublic void prepareResultSets(String sql, MockResultSet[] resultSets, Object[] parameters)
ResultSet objects for a specified SQL string and
the specified parameters. This method can be used for queries that return
multiple result sets. The specified parameters array
must contain the parameters in the correct order starting with index 0 for
the first parameter. Please keep in mind that parameters in
PreparedStatement objects start with 1 as the first
parameter. So parameters[0] maps to the
parameter with index 1.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).sql - the SQL stringresultSets - the corresponding MockResultSet[]parameters - the parameterspublic void prepareResultSet(String sql, MockResultSet resultSet, List<Object> parameters)
ResultSet for a specified SQL string and
the specified parameters. The specified parameters List
must contain the parameters in the correct order starting with index 0 for
the first parameter. Please keep in mind that parameters in
PreparedStatement objects start with 1 as the first
parameter. So parameters.get(0) maps to the
parameter with index 1.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).sql - the SQL stringresultSet - the corresponding MockResultSetparameters - the parameterspublic void prepareResultSets(String sql, MockResultSet[] resultSets, List<Object> parameters)
ResultSet objects for a specified SQL string and
the specified parameters. This method can be used for queries that return
multiple result sets. The specified parameters List
must contain the parameters in the correct order starting with index 0 for
the first parameter. Please keep in mind that parameters in
PreparedStatement objects start with 1 as the first
parameter. So parameters.get(0) maps to the
parameter with index 1.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).sql - the SQL stringresultSets - the corresponding MockResultSet[]parameters - the parameterspublic void prepareResultSet(String sql, MockResultSet resultSet, MockParameterMap parameters)
ResultSet for a specified SQL string and
the specified parameters. The specified parameters Map
must contain the parameters by mapping Integer objects
to the corresponding parameter. The Integer object
is the index of the parameter. In the case of a CallableStatement,
String keys for named parameters are also allowed.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).prepareResultSet in class AbstractResultSetHandlersql - the SQL stringresultSet - the corresponding MockResultSetparameters - the parameterspublic void prepareResultSets(String sql, MockResultSet[] resultSets, MockParameterMap parameters)
ResultSet objects for a specified SQL string and
the specified parameters. This method can be used for queries that return
multiple result sets. The specified parameters Map
must contain the parameters by mapping Integer objects
to the corresponding parameter. The Integer object
is the index of the parameter. In the case of a CallableStatement,
String keys for named parameters are also allowed.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).prepareResultSets in class AbstractResultSetHandlersql - the SQL stringresultSets - the corresponding MockResultSet[]parameters - the parameterspublic void prepareThrowsSQLException(String sql)
SQLException and will throw this
exception.prepareThrowsSQLException in class AbstractResultSetHandlersql - the SQL stringpublic void prepareThrowsSQLException(String sql, Object[] parameters)
SQLException and will throw this
exception. With prepareThrowsSQLException(String, SQLException, Object[])
you can specify the exception.
The specified parameters array must contain the parameters in
the correct order starting with index 0 for the first parameter.
Please keep in mind that parameters in PreparedStatement
objects start with 1 as the first parameter. So parameters[0]
maps to the parameter with index 1.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).sql - the SQL stringparameters - the parameterspublic void prepareThrowsSQLException(String sql, List<Object> parameters)
SQLException and will throw this
exception. With prepareThrowsSQLException(String, SQLException, List)
you can specify the exception.
The specified parameters List must contain the
parameters in the correct order starting with index 0 for the first
parameter. Please keep in mind that parameters in
PreparedStatement objects start with 1 as the first
parameter. So parameters.get(0) maps to the parameter
with index 1.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).sql - the SQL stringparameters - the parameterspublic void prepareThrowsSQLException(String sql, MockParameterMap parameters)
SQLException and will throw this
exception. With
you can specify the exception.
The specified parameters Map must contain the parameters by
mapping Integer objects to the corresponding parameter.
The Integer object is the index of the parameter. In the case
of a CallableStatement,
String keys for named parameters are also allowed.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).prepareThrowsSQLException in class AbstractResultSetHandlersql - the SQL stringparameters - the parameterspublic void prepareThrowsSQLException(String sql, SQLException exc)
SQLException and will throw this
exception.prepareThrowsSQLException in class AbstractResultSetHandlersql - the SQL stringexc - the SQLException that should be thrownpublic void prepareThrowsSQLException(String sql, SQLException exc, Object[] parameters)
PreparedStatement
objects start with 1 as the first parameter. So parameters[0]
maps to the parameter with index 1.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).sql - the SQL stringexc - the SQLException that should be thrownparameters - the parameterspublic void prepareThrowsSQLException(String sql, SQLException exc, List<Object> parameters)
List must contain the
parameters in the correct order starting with index 0 for the first
parameter. Please keep in mind that parameters in
PreparedStatement objects start with 1 as the first
parameter. So parameters.get(0) maps to the parameter
with index 1.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).sql - the SQL stringexc - the SQLException that should be thrownparameters - the parameterspublic void prepareThrowsSQLException(String sql, SQLException exc, MockParameterMap parameters)
Map must contain the parameters by
mapping Integer objects to the corresponding parameter.
The Integer object is the index of the parameter. In the case
of a CallableStatement,
String keys for named parameters are also allowed.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).prepareThrowsSQLException in class AbstractResultSetHandlersql - the SQL stringexc - the SQLException that should be thrownparameters - the parameterspublic void prepareUpdateCount(String sql, int updateCount)
prepareUpdateCount in class AbstractResultSetHandlersql - the SQL stringupdateCount - the update countpublic void prepareUpdateCounts(String sql, Integer[] updateCounts)
prepareUpdateCounts in class AbstractResultSetHandlersql - the SQL stringupdateCounts - the update countspublic void prepareUpdateCount(String sql, int updateCount, Object[] parameters)
PreparedStatement objects start with 1 as the first
parameter. So parameters[0] maps to the
parameter with index 1.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).sql - the SQL stringupdateCount - the update countparameters - the parameterspublic void prepareUpdateCounts(String sql, Integer[] updateCounts, Object[] parameters)
PreparedStatement objects start with 1 as the first
parameter. So parameters[0] maps to the
parameter with index 1.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).sql - the SQL stringupdateCounts - the update count arrayparameters - the parameterspublic void prepareUpdateCount(String sql, int updateCount, List<Object> parameters)
List
must contain the parameters in the correct order starting with index 0 for
the first parameter. Please keep in mind that parameters in
PreparedStatement objects start with 1 as the first
parameter. So parameters.get(0) maps to the
parameter with index 1.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).sql - the SQL stringupdateCount - the update countparameters - the parameterspublic void prepareUpdateCounts(String sql, Integer[] updateCounts, List<Object> parameters)
List
must contain the parameters in the correct order starting with index 0 for
the first parameter. Please keep in mind that parameters in
PreparedStatement objects start with 1 as the first
parameter. So parameters.get(0) maps to the
parameter with index 1.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).sql - the SQL stringupdateCounts - the update count arrayparameters - the parameterspublic void prepareUpdateCount(String sql, int updateCount, MockParameterMap parameters)
Map
must contain the parameters by mapping Integer objects
to the corresponding parameter. The Integer object
is the index of the parameter. In the case of a CallableStatement,
String keys for named parameters are also allowed.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).prepareUpdateCount in class AbstractResultSetHandlersql - the SQL stringupdateCount - the update countparameters - the parameterspublic void prepareUpdateCounts(String sql, Integer[] updateCounts, MockParameterMap parameters)
Map
must contain the parameters by mapping Integer objects
to the corresponding parameter. The Integer object
is the index of the parameter. In the case of a CallableStatement,
String keys for named parameters are also allowed.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).prepareUpdateCounts in class AbstractResultSetHandlersql - the SQL stringupdateCounts - the update count arrayparameters - the parameterspublic void prepareGeneratedKeys(String sql, MockResultSet generatedKeysResult)
ResultSet
for a specified SQL string with an empty parameter map.prepareGeneratedKeys in class AbstractResultSetHandlersql - the SQL stringgeneratedKeysResult - the generated keys MockResultSetpublic void prepareGeneratedKeys(String sql, MockResultSet generatedKeysResult, Object[] parameters)
ResultSet
for a specified SQL string.
The specified parameters array must contain the parameters in
the correct order starting with index 0 for the first parameter.
Please keep in mind that parameters in PreparedStatement
objects start with 1 as the first parameter. So parameters[0]
maps to the parameter with index 1.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).sql - the SQL stringgeneratedKeysResult - the generated keys MockResultSetparameters - the parameterspublic void prepareGeneratedKeys(String sql, MockResultSet generatedKeysResult, List<Object> parameters)
ResultSet
for a specified SQL string.
The specified parameters List must contain the
parameters in the correct order starting with index 0 for the first
parameter. Please keep in mind that parameters in
PreparedStatement objects start with 1 as the first
parameter. So parameters.get(0) maps to the parameter
with index 1.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).sql - the SQL stringgeneratedKeysResult - the generated keys MockResultSetparameters - the parameterspublic void prepareGeneratedKeys(String sql, MockResultSet generatedKeysResult, MockParameterMap parameters)
ResultSet
for a specified SQL string.
The specified parameters Map must contain the parameters by
mapping Integer objects to the corresponding parameter.
The Integer object is the index of the parameter. In the case
of a CallableStatement,
String keys for named parameters are also allowed.
Please note that you can modify the match parameters with
AbstractResultSetHandler.setCaseSensitive(boolean), AbstractResultSetHandler.setExactMatch(boolean) and
AbstractResultSetHandler.setUseRegularExpressions(boolean) and the match parameters for the
specified parameter list with setExactMatchParameter(boolean).prepareGeneratedKeys in class AbstractResultSetHandlersql - the SQL stringgeneratedKeysResult - the generated keys MockResultSetparameters - the parameterspublic void removeResultSet(String sql, MockParameterMap parameters)
sql - The SQL string associated with the resultsetparameters - public void removeThrowsSqlException(String sql, MockParameterMap parameters)
sql - The SQL string which identifies the conditions under which to throw a SQLExceptionparameters - public void removeUpdateCount(String sql, MockParameterMap parameters)
sql - The SQL string which identifies the conditions under which to return the specified update countparameters - public void removeGeneratedKeys(String sql, MockParameterMap parameters)
sql - The SQL string which identifies the conditions under which the generated keys result would be returned.parameters - Copyright © 2003–2023. All rights reserved.