public abstract class AbstractParameterResultSetHandler extends AbstractResultSetHandler
PreparedStatement
and CallableStatement.| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractParameterResultSetHandler.ParameterWrapper |
| Constructor and Description |
|---|
AbstractParameterResultSetHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
addParameterMapForExecutedStatement(String sql,
Map parameters)
Collects all SQL strings that were executed.
|
void |
clearGeneratedKeys()
Clears the list of statements that return generated keys.
|
void |
clearResultSets()
Clears the
ResultSet objects. |
void |
clearThrowsSQLException()
Clears the list of statements that should throw an exception
|
void |
clearUpdateCounts()
Clears the update counts.
|
Map |
getExecutedStatementParameter()
Deprecated.
|
Map |
getExecutedStatementParameterMap()
Returns the
Map of executed SQL strings. |
MockResultSet |
getGeneratedKeys(String sql,
Map parameters)
Returns the first generated keys
ResultSet that
matches the specified SQL string. |
protected AbstractParameterResultSetHandler.ParameterWrapper |
getMatchingParameterWrapper(String sql,
Map parameters,
Map statementMap) |
ParameterSets |
getParametersForExecutedStatement(String sql)
Returns the
ParameterSets for a specified
SQL string. |
MockResultSet |
getResultSet(String sql,
Map parameters)
Returns the first
ResultSet that matches the
specified SQL string and the specified parameters. |
MockResultSet[] |
getResultSets(String sql,
Map parameters)
Returns the first
ResultSet[] that matches the
specified SQL string and the specified parameters. |
SQLException |
getSQLException(String sql,
Map parameters)
Returns the
SQLException the specified SQL string
should throw. |
boolean |
getThrowsSQLException(String sql,
Map parameters)
Returns if the specified SQL string with the specified parameters
should raise an exception.
|
Integer |
getUpdateCount(String sql,
Map parameters)
Returns the first update count that matches the
specified SQL string and the specified parameters.
|
Integer[] |
getUpdateCounts(String sql,
Map parameters)
Returns the first update count array that matches the
specified SQL string and the specified parameters.
|
boolean |
hasMultipleResultSets(String sql,
Map parameters)
Returns the if the specified SQL string with the specified parameters
returns multiple result sets.
|
boolean |
hasMultipleUpdateCounts(String sql,
Map parameters)
Returns the if the specified SQL string with the specified parameters
returns multiple update counts.
|
void |
prepareGeneratedKeys(String sql,
MockResultSet generatedKeysResult,
List parameters)
Prepare the generated keys
ResultSet
for a specified SQL string. |
void |
prepareGeneratedKeys(String sql,
MockResultSet generatedKeysResult,
Map 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,
List parameters)
Prepare a
ResultSet for a specified SQL string and
the specified parameters. |
void |
prepareResultSet(String sql,
MockResultSet resultSet,
Map 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,
List parameters)
Prepare an array of
ResultSet objects for a specified SQL string and
the specified parameters. |
void |
prepareResultSets(String sql,
MockResultSet[] resultSets,
Map 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,
List parameters)
Prepare that the specified SQL string with the specified parameters
should raise an exception.
|
void |
prepareThrowsSQLException(String sql,
Map 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,
List parameters)
Prepare that the specified SQL string with the specified parameters
should raise an exception.
|
void |
prepareThrowsSQLException(String sql,
SQLException exc,
Map 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,
List parameters)
Prepare the update count for execute update calls for a specified SQL string
and the specified parameters.
|
void |
prepareUpdateCount(String sql,
int updateCount,
Map 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,
int[] updateCounts,
List parameters)
Prepare an array update count values for execute update calls for a specified SQL string
and the specified parameters.
|
void |
prepareUpdateCounts(String sql,
int[] updateCounts,
Map parameters)
Prepare an array update count values for execute update calls for a specified SQL string
and the specified parameters.
|
void |
prepareUpdateCounts(String sql,
int[] updateCounts,
Object[] parameters)
Prepare an array update count values for execute update calls for a specified SQL string
and the specified parameters.
|
void |
setExactMatchParameter(boolean exactMatchParameter)
Sets if the specified parameters must match exactly
in order and number.
|
addExecutedStatement, addReturnedResultSet, addReturnedResultSets, clearGlobalGeneratedKeys, clearGlobalResultSet, clearGlobalUpdateCount, clearReturnsResultSet, createResultSet, createResultSet, createResultSet, createResultSet, getCaseSensitive, getContinueProcessingOnBatchFailure, getExactMatch, getExecutedStatements, getGeneratedKeys, getGeneratedKeysMap, getGlobalGeneratedKeys, getGlobalResultSet, getGlobalResultSets, getGlobalUpdateCount, getGlobalUpdateCounts, getResultSet, getResultSetMap, getResultSets, getReturnedResultSets, getReturnsResultSet, getSQLException, getThrowsSQLException, getUpdateCount, getUpdateCountMap, getUpdateCounts, getUseRegularExpressions, hasMultipleGlobalResultSets, hasMultipleGlobalUpdateCounts, hasMultipleResultSets, hasMultipleUpdateCounts, prepareGeneratedKeys, prepareGlobalGeneratedKeys, prepareGlobalResultSet, prepareGlobalResultSets, prepareGlobalUpdateCount, prepareGlobalUpdateCounts, prepareResultSet, prepareResultSets, prepareReturnsResultSet, prepareThrowsSQLException, prepareThrowsSQLException, prepareUpdateCount, prepareUpdateCounts, setCaseSensitive, setContinueProcessingOnBatchFailure, setExactMatch, setUseRegularExpressionspublic void addParameterMapForExecutedStatement(String sql, Map 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 getExecutedStatementParameterMap()
Map of executed SQL strings.
Each string maps to the corresponding ParameterSets
object.Map of parameterspublic Map 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, Map 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, Map 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, Map 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, Map 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, Map 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, Map 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, Map 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, Map 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, Map 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 parametersMockResultSetprotected AbstractParameterResultSetHandler.ParameterWrapper getMatchingParameterWrapper(String sql, Map parameters, Map statementMap)
public void clearResultSets()
ResultSet objects.clearResultSets in class AbstractResultSetHandlerpublic void clearUpdateCounts()
clearUpdateCounts in class AbstractResultSetHandlerpublic void clearThrowsSQLException()
clearThrowsSQLException in class AbstractResultSetHandlerpublic void clearGeneratedKeys()
clearGeneratedKeys in class AbstractResultSetHandlerpublic 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 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 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, Map 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).sql - the SQL stringresultSet - the corresponding MockResultSetparameters - the parameterspublic void prepareResultSets(String sql, MockResultSet[] resultSets, Map 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).sql - the SQL stringresultSets - the corresponding MockResultSet[]parameters - the parameterspublic 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 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, Map parameters)
SQLException and will throw this
exception. With prepareThrowsSQLException(String, SQLException, Map)
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).sql - the SQL stringparameters - the parameterspublic 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 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, Map 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).sql - the SQL stringexc - the SQLException that should be thrownparameters - the parameterspublic 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, int[] 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 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, int[] updateCounts, List 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, Map 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).sql - the SQL stringupdateCount - the update countparameters - the parameterspublic void prepareUpdateCounts(String sql, int[] updateCounts, Map 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).sql - the SQL stringupdateCounts - the update count arrayparameters - the parameterspublic 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 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, Map 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).sql - the SQL stringgeneratedKeysResult - the generated keys MockResultSetparameters - the parametersCopyright © 2003-2014. All Rights Reserved.