public class CallableStatementCreatorFactory
extends java.lang.Object
CallableStatementCreator
objects with different parameters based on a SQL statement and a single
set of parameter declarations.Modifier and Type | Class and Description |
---|---|
private class |
CallableStatementCreatorFactory.CallableStatementCreatorImpl
CallableStatementCreator implementation returned by this class.
|
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
callString
The SQL call string, which won't change when the parameters change.
|
private java.util.List<SqlParameter> |
declaredParameters
List of SqlParameter objects.
|
private NativeJdbcExtractor |
nativeJdbcExtractor |
private int |
resultSetType |
private boolean |
updatableResults |
Constructor and Description |
---|
CallableStatementCreatorFactory(java.lang.String callString)
Create a new factory.
|
CallableStatementCreatorFactory(java.lang.String callString,
java.util.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.
|
CallableStatementCreator |
newCallableStatementCreator(java.util.Map<java.lang.String,?> params)
Return a new CallableStatementCreator instance given this parameters.
|
CallableStatementCreator |
newCallableStatementCreator(ParameterMapper inParamMapper)
Return a new CallableStatementCreator instance given this parameter mapper.
|
void |
setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor)
Specify the NativeJdbcExtractor to use for unwrapping CallableStatements, if any.
|
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.
|
private final java.lang.String callString
private final java.util.List<SqlParameter> declaredParameters
null
.private int resultSetType
private boolean updatableResults
private NativeJdbcExtractor nativeJdbcExtractor
public CallableStatementCreatorFactory(java.lang.String callString)
addParameter(org.springframework.jdbc.core.SqlParameter)
method or have no parameters.public CallableStatementCreatorFactory(java.lang.String callString, java.util.List<SqlParameter> declaredParameters)
callString
- the SQL call stringdeclaredParameters
- list of SqlParameter
objectspublic 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 void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor)
public CallableStatementCreator newCallableStatementCreator(java.util.Map<java.lang.String,?> params)
params
- list of parameters (may be null
)public CallableStatementCreator newCallableStatementCreator(ParameterMapper inParamMapper)
inParamMapper
- ParameterMapper implementation that will return a Map of parameters