类 SqlCall
- java.lang.Object
- org.springframework.jdbc.object.RdbmsOperation
- org.springframework.jdbc.object.SqlCall
- 所有已实现的接口:
InitializingBean
- 直接已知子类:
StoredProcedure
public abstract class SqlCall extends RdbmsOperation
RdbmsOperation using a JdbcTemplate and representing a SQL-based call such as a stored procedure or a stored function.Configures a CallableStatementCreatorFactory based on the declared parameters.
- 作者:
- Rod Johnson, Thomas Risberg
- 另请参阅:
CallableStatementCreatorFactory
字段概要
从类继承的字段 org.springframework.jdbc.object.RdbmsOperation
logger
构造器概要
构造器 构造器 说明 SqlCall()
Constructor to allow use as a JavaBean.SqlCall(DataSource ds, String sql)
Create a new SqlCall object with SQL, but without parameters.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected void
compileInternal()
Overridden method to configure the CallableStatementCreatorFactory based on our declared parameters.String
getCallString()
Get the call string.boolean
isFunction()
Return whether this call is for a function.boolean
isSqlReadyForUse()
Return whether the SQL can be used as is.protected CallableStatementCreator
newCallableStatementCreator(Map<String,?> inParams)
Return a CallableStatementCreator to perform an operation with this parameters.protected CallableStatementCreator
newCallableStatementCreator(ParameterMapper inParamMapper)
Return a CallableStatementCreator to perform an operation with the parameters returned from this ParameterMapper.protected void
onCompileInternal()
Hook method that subclasses may override to react to compilation.void
setFunction(boolean function)
Set whether this call is for a function.void
setSqlReadyForUse(boolean sqlReadyForUse)
Set whether the SQL can be used as is.从类继承的方法 org.springframework.jdbc.object.RdbmsOperation
afterPropertiesSet, allowsUnusedParameters, checkCompiled, compile, declareParameter, getDeclaredParameters, getGeneratedKeysColumnNames, getJdbcTemplate, getResultSetType, getSql, isCompiled, isReturnGeneratedKeys, isUpdatableResults, setDataSource, setFetchSize, setGeneratedKeysColumnNames, setJdbcTemplate, setMaxRows, setParameters, setQueryTimeout, setResultSetType, setReturnGeneratedKeys, setSql, setTypes, setUpdatableResults, supportsLobParameters, validateNamedParameters, validateParameters
构造器详细资料
SqlCall
public SqlCall()
Constructor to allow use as a JavaBean. A DataSource, SQL and any parameters must be supplied before invoking thecompile
method and using this object.
SqlCall
public SqlCall(DataSource ds, String sql)
Create a new SqlCall object with SQL, but without parameters. Must add parameters or settle with none.- 参数:
ds
- the DataSource to obtain connections fromsql
- the SQL to execute
方法详细资料
setFunction
public void setFunction(boolean function)
Set whether this call is for a function.
isFunction
public boolean isFunction()
Return whether this call is for a function.
setSqlReadyForUse
public void setSqlReadyForUse(boolean sqlReadyForUse)
Set whether the SQL can be used as is.
isSqlReadyForUse
public boolean isSqlReadyForUse()
Return whether the SQL can be used as is.
compileInternal
protected final void compileInternal()
Overridden method to configure the CallableStatementCreatorFactory based on our declared parameters.
onCompileInternal
protected void onCompileInternal()
Hook method that subclasses may override to react to compilation. This implementation does nothing.
getCallString
public String getCallString()
Get the call string.
newCallableStatementCreator
protected CallableStatementCreator newCallableStatementCreator(Map<String,?> inParams)
Return a CallableStatementCreator to perform an operation with this parameters.- 参数:
inParams
- parameters. May benull
.
newCallableStatementCreator
protected CallableStatementCreator newCallableStatementCreator(ParameterMapper inParamMapper)
Return a CallableStatementCreator to perform an operation with the parameters returned from this ParameterMapper.- 参数:
inParamMapper
- parametermapper. May not benull
.