public class CallableStatementCreatorFactory extends Object
CallableStatementCreator
objects with different parameters based on an SQL statement and a single
set of parameter declarations.Constructor and Description |
---|
CallableStatementCreatorFactory(String callString)
Create a new factory.
|
CallableStatementCreatorFactory(String callString,
List<SqlParameter> declaredParameters)
Create a new factory with the given SQL and the given parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
addParameter(SqlParameter param)
Add a new declared parameter.
|
String |
getCallString()
Return the SQL call string.
|
CallableStatementCreator |
newCallableStatementCreator(Map<String,?> params)
Return a new CallableStatementCreator instance given these parameters.
|
CallableStatementCreator |
newCallableStatementCreator(ParameterMapper inParamMapper)
Return a new CallableStatementCreator instance given this parameter mapper.
|
void |
setResultSetType(int resultSetType)
Set whether to use prepared statements that return a specific type of ResultSet.
|
void |
setUpdatableResults(boolean updatableResults)
Set whether to use prepared statements capable of returning updatable ResultSets.
|
public CallableStatementCreatorFactory(String callString)
addParameter(org.springframework.jdbc.core.SqlParameter)
method or have no parameters.callString
- the SQL call stringpublic CallableStatementCreatorFactory(String callString, List<SqlParameter> declaredParameters)
callString
- the SQL call stringdeclaredParameters
- list of SqlParameter
objectspublic final String getCallString()
public void addParameter(SqlParameter param)
Order of parameter addition is significant.
param
- the parameter to add to the list of declared parameterspublic void setResultSetType(int resultSetType)
resultSetType
- the ResultSet typeResultSet.TYPE_FORWARD_ONLY
,
ResultSet.TYPE_SCROLL_INSENSITIVE
,
ResultSet.TYPE_SCROLL_SENSITIVE
public void setUpdatableResults(boolean updatableResults)
public CallableStatementCreator newCallableStatementCreator(@Nullable Map<String,?> params)
params
- list of parameters (may be null
)public CallableStatementCreator newCallableStatementCreator(ParameterMapper inParamMapper)
inParamMapper
- the ParameterMapper implementation that will return a Map of parameters