public abstract class StoredProcedure extends SqlCall
execute(java.lang.Object...)
method.
The inherited sql
property is the name of the stored procedure
in the RDBMS.
logger
Modifier | Constructor and Description |
---|---|
protected |
StoredProcedure()
Allow use as a bean.
|
protected |
StoredProcedure(javax.sql.DataSource ds,
java.lang.String name)
Create a new object wrapper for a stored procedure.
|
protected |
StoredProcedure(JdbcTemplate jdbcTemplate,
java.lang.String name)
Create a new object wrapper for a stored procedure.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
allowsUnusedParameters()
StoredProcedure parameter Maps are by default allowed to contain
additional entries that are not actually used as parameters.
|
void |
declareParameter(SqlParameter param)
Declare a parameter.
|
java.util.Map<java.lang.String,java.lang.Object> |
execute(java.util.Map<java.lang.String,?> inParams)
Execute the stored procedure.
|
java.util.Map<java.lang.String,java.lang.Object> |
execute(java.lang.Object... inParams)
Execute the stored procedure with the provided parameter values.
|
java.util.Map<java.lang.String,java.lang.Object> |
execute(ParameterMapper inParamMapper)
Execute the stored procedure.
|
compileInternal, getCallString, isFunction, isSqlReadyForUse, newCallableStatementCreator, newCallableStatementCreator, onCompileInternal, setFunction, setSqlReadyForUse
afterPropertiesSet, checkCompiled, compile, getDeclaredParameters, getGeneratedKeysColumnNames, getJdbcTemplate, getResultSetType, getSql, isCompiled, isReturnGeneratedKeys, isUpdatableResults, resolveSql, setDataSource, setFetchSize, setGeneratedKeysColumnNames, setJdbcTemplate, setMaxRows, setParameters, setQueryTimeout, setResultSetType, setReturnGeneratedKeys, setSql, setTypes, setUpdatableResults, supportsLobParameters, validateNamedParameters, validateParameters
protected StoredProcedure()
protected StoredProcedure(javax.sql.DataSource ds, java.lang.String name)
ds
- DataSource to use throughout the lifetime
of this object to obtain connectionsname
- name of the stored procedure in the databaseprotected StoredProcedure(JdbcTemplate jdbcTemplate, java.lang.String name)
jdbcTemplate
- JdbcTemplate which wraps DataSourcename
- name of the stored procedure in the databaseprotected boolean allowsUnusedParameters()
allowsUnusedParameters
in class RdbmsOperation
StoredProcedure
public void declareParameter(SqlParameter param) throws InvalidDataAccessApiUsageException
SqlParameter
and SqlInOutParameter
will always be used to provide input values. In addition to this any parameter declared
as SqlOutParameter
where an non-null input value is provided will also be used
as an input paraneter.
Note: Calls to declareParameter must be made in the same order as
they appear in the database's stored procedure parameter list.
Names are purely used to help mapping.declareParameter
in class RdbmsOperation
param
- parameter objectInvalidDataAccessApiUsageException
- if the operation is already compiled,
and hence cannot be configured furtherpublic java.util.Map<java.lang.String,java.lang.Object> execute(java.lang.Object... inParams)
inParams
- variable number of input parameters. Output parameters should
not be included in this map. It is legal for values to be null
, and this
will produce the correct behavior using a NULL argument to the stored procedure.public java.util.Map<java.lang.String,java.lang.Object> execute(java.util.Map<java.lang.String,?> inParams) throws DataAccessException
inParams
- map of input parameters, keyed by name as in parameter
declarations. Output parameters need not (but can) be included in this map.
It is legal for map entries to be null
, and this will produce the
correct behavior using a NULL argument to the stored procedure.DataAccessException
public java.util.Map<java.lang.String,java.lang.Object> execute(ParameterMapper inParamMapper) throws DataAccessException
inParamMapper
- map of input parameters, keyed by name as in parameter
declarations. Output parameters need not (but can) be included in this map.
It is legal for map entries to be null
, and this will produce the correct
behavior using a NULL argument to the stored procedure.DataAccessException