|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.mockrunner.jdbc.AbstractResultSetHandler com.mockrunner.jdbc.AbstractParameterResultSetHandler
public abstract class AbstractParameterResultSetHandler
Abstract base class for all statement types
that support parameters, i.e. PreparedStatement
and CallableStatement
.
Nested Class Summary | |
---|---|
protected class |
AbstractParameterResultSetHandler.ParameterWrapper
|
Constructor Summary | |
---|---|
AbstractParameterResultSetHandler()
|
Method Summary | |
---|---|
void |
addParameterMapForExecutedStatement(java.lang.String sql,
java.util.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. |
java.util.Map |
getExecutedStatementParameter()
Deprecated. use getExecutedStatementParameterMap() |
java.util.Map |
getExecutedStatementParameterMap()
Returns the Map of executed SQL strings. |
MockResultSet |
getGeneratedKeys(java.lang.String sql,
java.util.Map parameters)
Returns the first generated keys ResultSet that
matches the specified SQL string. |
protected AbstractParameterResultSetHandler.ParameterWrapper |
getMatchingParameterWrapper(java.lang.String sql,
java.util.Map parameters,
java.util.Map statementMap)
|
ParameterSets |
getParametersForExecutedStatement(java.lang.String sql)
Returns the ParameterSets for a specified
SQL string. |
MockResultSet |
getResultSet(java.lang.String sql,
java.util.Map parameters)
Returns the first ResultSet that matches the
specified SQL string and the specified parameters. |
MockResultSet[] |
getResultSets(java.lang.String sql,
java.util.Map parameters)
Returns the first ResultSet[] that matches the
specified SQL string and the specified parameters. |
java.sql.SQLException |
getSQLException(java.lang.String sql,
java.util.Map parameters)
Returns the SQLException the specified SQL string
should throw. |
boolean |
getThrowsSQLException(java.lang.String sql,
java.util.Map parameters)
Returns if the specified SQL string with the specified parameters should raise an exception. |
java.lang.Integer |
getUpdateCount(java.lang.String sql,
java.util.Map parameters)
Returns the first update count that matches the specified SQL string and the specified parameters. |
java.lang.Integer[] |
getUpdateCounts(java.lang.String sql,
java.util.Map parameters)
Returns the first update count array that matches the specified SQL string and the specified parameters. |
boolean |
hasMultipleResultSets(java.lang.String sql,
java.util.Map parameters)
Returns the if the specified SQL string with the specified parameters returns multiple result sets. |
boolean |
hasMultipleUpdateCounts(java.lang.String sql,
java.util.Map parameters)
Returns the if the specified SQL string with the specified parameters returns multiple update counts. |
void |
prepareGeneratedKeys(java.lang.String sql,
MockResultSet generatedKeysResult,
java.util.List parameters)
Prepare the generated keys ResultSet
for a specified SQL string. |
void |
prepareGeneratedKeys(java.lang.String sql,
MockResultSet generatedKeysResult,
java.util.Map parameters)
Prepare the generated keys ResultSet
for a specified SQL string. |
void |
prepareGeneratedKeys(java.lang.String sql,
MockResultSet generatedKeysResult,
java.lang.Object[] parameters)
Prepare the generated keys ResultSet
for a specified SQL string. |
void |
prepareResultSet(java.lang.String sql,
MockResultSet resultSet,
java.util.List parameters)
Prepare a ResultSet for a specified SQL string and
the specified parameters. |
void |
prepareResultSet(java.lang.String sql,
MockResultSet resultSet,
java.util.Map parameters)
Prepare a ResultSet for a specified SQL string and
the specified parameters. |
void |
prepareResultSet(java.lang.String sql,
MockResultSet resultSet,
java.lang.Object[] parameters)
Prepare a ResultSet for a specified SQL string and
the specified parameters. |
void |
prepareResultSets(java.lang.String sql,
MockResultSet[] resultSets,
java.util.List parameters)
Prepare an array of ResultSet objects for a specified SQL string and
the specified parameters. |
void |
prepareResultSets(java.lang.String sql,
MockResultSet[] resultSets,
java.util.Map parameters)
Prepare an array of ResultSet objects for a specified SQL string and
the specified parameters. |
void |
prepareResultSets(java.lang.String sql,
MockResultSet[] resultSets,
java.lang.Object[] parameters)
Prepare an array of ResultSet objects for a specified SQL string and
the specified parameters. |
void |
prepareThrowsSQLException(java.lang.String sql,
java.util.List parameters)
Prepare that the specified SQL string with the specified parameters should raise an exception. |
void |
prepareThrowsSQLException(java.lang.String sql,
java.util.Map parameters)
Prepare that the specified SQL string with the specified parameters should raise an exception. |
void |
prepareThrowsSQLException(java.lang.String sql,
java.lang.Object[] parameters)
Prepare that the specified SQL string with the specified parameters should raise an exception. |
void |
prepareThrowsSQLException(java.lang.String sql,
java.sql.SQLException exc,
java.util.List parameters)
Prepare that the specified SQL string with the specified parameters should raise an exception. |
void |
prepareThrowsSQLException(java.lang.String sql,
java.sql.SQLException exc,
java.util.Map parameters)
Prepare that the specified SQL string with the specified parameters should raise an exception. |
void |
prepareThrowsSQLException(java.lang.String sql,
java.sql.SQLException exc,
java.lang.Object[] parameters)
Prepare that the specified SQL string with the specified parameters should raise an exception. |
void |
prepareUpdateCount(java.lang.String sql,
int updateCount,
java.util.List parameters)
Prepare the update count for execute update calls for a specified SQL string and the specified parameters. |
void |
prepareUpdateCount(java.lang.String sql,
int updateCount,
java.util.Map parameters)
Prepare the update count for execute update calls for a specified SQL string and the specified parameters. |
void |
prepareUpdateCount(java.lang.String sql,
int updateCount,
java.lang.Object[] parameters)
Prepare the update count for execute update calls for a specified SQL string and the specified parameters. |
void |
prepareUpdateCounts(java.lang.String sql,
int[] updateCounts,
java.util.List parameters)
Prepare an array update count values for execute update calls for a specified SQL string and the specified parameters. |
void |
prepareUpdateCounts(java.lang.String sql,
int[] updateCounts,
java.util.Map parameters)
Prepare an array update count values for execute update calls for a specified SQL string and the specified parameters. |
void |
prepareUpdateCounts(java.lang.String sql,
int[] updateCounts,
java.lang.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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractParameterResultSetHandler()
Method Detail |
---|
public void addParameterMapForExecutedStatement(java.lang.String sql, java.util.Map parameters)
sql
- the SQL stringparameters
- a copy of the corresponding parameter mappublic ParameterSets getParametersForExecutedStatement(java.lang.String sql)
ParameterSets
for a specified
SQL string.
sql
- the SQL string
Map
of parameterspublic java.util.Map getExecutedStatementParameterMap()
Map
of executed SQL strings.
Each string maps to the corresponding ParameterSets
object.
Map
of parameterspublic java.util.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 java.lang.Integer getUpdateCount(java.lang.String sql, java.util.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 parameters
public java.lang.Integer[] getUpdateCounts(java.lang.String sql, java.util.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 parameters
public boolean hasMultipleUpdateCounts(java.lang.String sql, java.util.Map parameters)
AbstractResultSetHandler.setCaseSensitive(boolean)
,
AbstractResultSetHandler.setExactMatch(boolean)
and AbstractResultSetHandler.setUseRegularExpressions(boolean)
.
sql
- the SQL string
true
if the SQL string returns multiple update counts,
false
otherwisepublic MockResultSet getResultSet(java.lang.String sql, java.util.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 parameters
MockResultSet
public MockResultSet[] getResultSets(java.lang.String sql, java.util.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 parameters
public boolean hasMultipleResultSets(java.lang.String sql, java.util.Map parameters)
AbstractResultSetHandler.setCaseSensitive(boolean)
,
AbstractResultSetHandler.setExactMatch(boolean)
and AbstractResultSetHandler.setUseRegularExpressions(boolean)
.
sql
- the SQL string
true
if the SQL string returns multiple update counts,
false
otherwisepublic boolean getThrowsSQLException(java.lang.String sql, java.util.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 parameters
true
if the specified SQL string should raise an exception,
false
otherwisepublic java.sql.SQLException getSQLException(java.lang.String sql, java.util.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 parameters
SQLException
or null
public MockResultSet getGeneratedKeys(java.lang.String sql, java.util.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 parameters
MockResultSet
protected AbstractParameterResultSetHandler.ParameterWrapper getMatchingParameterWrapper(java.lang.String sql, java.util.Map parameters, java.util.Map statementMap)
public void clearResultSets()
ResultSet
objects.
clearResultSets
in class AbstractResultSetHandler
public void clearUpdateCounts()
clearUpdateCounts
in class AbstractResultSetHandler
public void clearThrowsSQLException()
clearThrowsSQLException
in class AbstractResultSetHandler
public void clearGeneratedKeys()
clearGeneratedKeys
in class AbstractResultSetHandler
public void prepareResultSet(java.lang.String sql, MockResultSet resultSet, java.lang.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 MockResultSet
parameters
- the parameterspublic void prepareResultSets(java.lang.String sql, MockResultSet[] resultSets, java.lang.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(java.lang.String sql, MockResultSet resultSet, java.util.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 MockResultSet
parameters
- the parameterspublic void prepareResultSets(java.lang.String sql, MockResultSet[] resultSets, java.util.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(java.lang.String sql, MockResultSet resultSet, java.util.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 MockResultSet
parameters
- the parameterspublic void prepareResultSets(java.lang.String sql, MockResultSet[] resultSets, java.util.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(java.lang.String sql, java.lang.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(java.lang.String sql, java.util.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(java.lang.String sql, java.util.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(java.lang.String sql, java.sql.SQLException exc, java.lang.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(java.lang.String sql, java.sql.SQLException exc, java.util.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(java.lang.String sql, java.sql.SQLException exc, java.util.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(java.lang.String sql, int updateCount, java.lang.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(java.lang.String sql, int[] updateCounts, java.lang.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(java.lang.String sql, int updateCount, java.util.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(java.lang.String sql, int[] updateCounts, java.util.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(java.lang.String sql, int updateCount, java.util.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(java.lang.String sql, int[] updateCounts, java.util.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(java.lang.String sql, MockResultSet generatedKeysResult, java.lang.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 MockResultSet
parameters
- the parameterspublic void prepareGeneratedKeys(java.lang.String sql, MockResultSet generatedKeysResult, java.util.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 MockResultSet
parameters
- the parameterspublic void prepareGeneratedKeys(java.lang.String sql, MockResultSet generatedKeysResult, java.util.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 MockResultSet
parameters
- the parameters
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |