类 CallableStatementCreatorFactory
- java.lang.Object
- org.springframework.jdbc.core.CallableStatementCreatorFactory
public class CallableStatementCreatorFactory extends Object
Helper class that efficiently creates multipleCallableStatementCreator
objects with different parameters based on an SQL statement and a single set of parameter declarations.- 作者:
- Rod Johnson, Thomas Risberg, Juergen Hoeller
构造器概要
构造器 构造器 说明 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.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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 this 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.
构造器详细资料
CallableStatementCreatorFactory
public CallableStatementCreatorFactory(String callString)
Create a new factory. Will need to add parameters via theaddParameter(org.springframework.jdbc.core.SqlParameter)
method or have no parameters.- 参数:
callString
- the SQL call string
CallableStatementCreatorFactory
public CallableStatementCreatorFactory(String callString, List<SqlParameter> declaredParameters)
Create a new factory with the given SQL and the given parameters.- 参数:
callString
- the SQL call stringdeclaredParameters
- list ofSqlParameter
objects
方法详细资料
getCallString
public final String getCallString()
Return the SQL call string.- 从以下版本开始:
- 5.1.3
addParameter
public void addParameter(SqlParameter param)
Add a new declared parameter.Order of parameter addition is significant.
- 参数:
param
- the parameter to add to the list of declared parameters
setResultSetType
public void setResultSetType(int resultSetType)
Set whether to use prepared statements that return a specific type of ResultSet. specific type of ResultSet.- 参数:
resultSetType
- the ResultSet type- 另请参阅:
ResultSet.TYPE_FORWARD_ONLY
,ResultSet.TYPE_SCROLL_INSENSITIVE
,ResultSet.TYPE_SCROLL_SENSITIVE
setUpdatableResults
public void setUpdatableResults(boolean updatableResults)
Set whether to use prepared statements capable of returning updatable ResultSets.
newCallableStatementCreator
public CallableStatementCreator newCallableStatementCreator(@Nullable Map<String,?> params)
Return a new CallableStatementCreator instance given this parameters.- 参数:
params
- list of parameters (may benull
)
newCallableStatementCreator
public CallableStatementCreator newCallableStatementCreator(ParameterMapper inParamMapper)
Return a new CallableStatementCreator instance given this parameter mapper.- 参数:
inParamMapper
- the ParameterMapper implementation that will return a Map of parameters