Class SqlCall
java.lang.Object
org.springframework.jdbc.object.RdbmsOperation
org.springframework.jdbc.object.SqlCall
- All Implemented Interfaces:
- InitializingBean
- Direct Known Subclasses:
- StoredProcedure
RdbmsOperation using a JdbcTemplate and representing an SQL-based
 call such as a stored procedure or a stored function.
 
Configures a CallableStatementCreatorFactory based on the declared parameters.
- Author:
- Rod Johnson, Thomas Risberg
- See Also:
- 
Field SummaryFields inherited from class org.springframework.jdbc.object.RdbmsOperationlogger
- 
Constructor SummaryConstructorsConstructorDescriptionSqlCall()Constructor to allow use as a JavaBean.SqlCall(DataSource ds, String sql) Create a new SqlCall object with SQL, but without parameters.
- 
Method SummaryModifier and TypeMethodDescriptionprotected final voidOverridden method to configure the CallableStatementCreatorFactory based on our declared parameters.Get the call string.booleanReturn whether this call is for a function.booleanReturn whether the SQL can be used as is.protected CallableStatementCreatornewCallableStatementCreator(@Nullable Map<String, ?> inParams) Return a CallableStatementCreator to perform an operation with these parameters.protected CallableStatementCreatornewCallableStatementCreator(ParameterMapper inParamMapper) Return a CallableStatementCreator to perform an operation with the parameters returned from this ParameterMapper.protected voidHook method that subclasses may override to react to compilation.voidsetFunction(boolean function) Set whether this call is for a function.voidsetSqlReadyForUse(boolean sqlReadyForUse) Set whether the SQL can be used as is.Methods inherited from class org.springframework.jdbc.object.RdbmsOperationafterPropertiesSet, allowsUnusedParameters, checkCompiled, compile, declareParameter, getDeclaredParameters, getGeneratedKeysColumnNames, getJdbcTemplate, getResultSetType, getSql, isCompiled, isReturnGeneratedKeys, isUpdatableResults, resolveSql, setDataSource, setFetchSize, setGeneratedKeysColumnNames, setJdbcTemplate, setMaxRows, setParameters, setQueryTimeout, setResultSetType, setReturnGeneratedKeys, setSql, setTypes, setUpdatableResults, supportsLobParameters, validateNamedParameters, validateParameters
- 
Constructor Details- 
SqlCallpublic SqlCall()Constructor to allow use as a JavaBean. A DataSource, SQL and any parameters must be supplied before invoking thecompilemethod and using this object.- See Also:
 
- 
SqlCallCreate a new SqlCall object with SQL, but without parameters. Must add parameters or settle with none.- Parameters:
- ds- the DataSource to obtain connections from
- sql- the SQL to execute
 
 
- 
- 
Method Details- 
setFunctionpublic void setFunction(boolean function) Set whether this call is for a function.
- 
isFunctionpublic boolean isFunction()Return whether this call is for a function.
- 
setSqlReadyForUsepublic void setSqlReadyForUse(boolean sqlReadyForUse) Set whether the SQL can be used as is.
- 
isSqlReadyForUsepublic boolean isSqlReadyForUse()Return whether the SQL can be used as is.
- 
compileInternalprotected final void compileInternal()Overridden method to configure the CallableStatementCreatorFactory based on our declared parameters.- Specified by:
- compileInternalin class- RdbmsOperation
- See Also:
 
- 
onCompileInternalprotected void onCompileInternal()Hook method that subclasses may override to react to compilation. This implementation does nothing.
- 
getCallString
- 
newCallableStatementCreatorReturn a CallableStatementCreator to perform an operation with these parameters.- Parameters:
- inParams- parameters. May be- null.
 
- 
newCallableStatementCreatorReturn a CallableStatementCreator to perform an operation with the parameters returned from this ParameterMapper.- Parameters:
- inParamMapper- parametermapper. May not be- null.
 
 
-