public abstract class AbstractJdbcCall
extends java.lang.Object
SimpleJdbcCall
.Modifier and Type | Field and Description |
---|---|
protected Log |
logger
Logger available to subclasses
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractJdbcCall(javax.sql.DataSource dataSource)
Constructor to be used when initializing using a
DataSource . |
protected |
AbstractJdbcCall(JdbcTemplate jdbcTemplate)
Constructor to be used when initializing using a
JdbcTemplate . |
Modifier and Type | Method and Description |
---|---|
void |
addDeclaredParameter(SqlParameter parameter)
Add a declared parameter to the list of parameters for the call.
|
void |
addDeclaredRowMapper(java.lang.String parameterName,
RowMapper<?> rowMapper)
Add a
RowMapper for the specified parameter or column. |
protected void |
checkCompiled()
Check whether this operation has been compiled already;
lazily compile it if not already compiled.
|
void |
compile()
Compile this JdbcCall using provided parameters and meta data plus other settings.
|
protected void |
compileInternal()
Method to perform the actual compilation.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
doExecute(java.util.Map<java.lang.String,?> args)
Method that provides execution of the call using the passed in Map of parameters
|
protected java.util.Map<java.lang.String,java.lang.Object> |
doExecute(java.lang.Object[] args)
Method that provides execution of the call using the passed in array of parameters
|
protected java.util.Map<java.lang.String,java.lang.Object> |
doExecute(SqlParameterSource parameterSource)
Method that provides execution of the call using the passed in
SqlParameterSource |
protected CallableStatementCreatorFactory |
getCallableStatementFactory()
Get the
CallableStatementCreatorFactory being used |
protected java.util.List<SqlParameter> |
getCallParameters()
Get a List of all the call parameters to be used for call.
|
java.lang.String |
getCallString()
Get the call string that should be used based on parameters and meta data.
|
java.lang.String |
getCatalogName()
Get the catalog name used.
|
java.util.Set<java.lang.String> |
getInParameterNames()
Get the names of in parameters to be used.
|
JdbcTemplate |
getJdbcTemplate()
Get the configured
JdbcTemplate . |
java.lang.String |
getProcedureName()
Get the name of the stored procedure.
|
protected java.lang.String |
getScalarOutParameterName()
Get the name of a single out parameter or return value.
|
java.lang.String |
getSchemaName()
Get the schema name used.
|
boolean |
isCompiled()
Is this operation "compiled"?
|
boolean |
isFunction()
Is this call a function call?
|
boolean |
isReturnValueRequired()
Does the call require a return value?
|
protected java.util.Map<java.lang.String,?> |
matchInParameterValuesWithCallParameters(java.util.Map<java.lang.String,?> args)
Match the provided in parameter values with registered parameters and
parameters defined via metadata processing.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
matchInParameterValuesWithCallParameters(SqlParameterSource parameterSource)
Match the provided in parameter values with registered parameters and
parameters defined via metadata processing.
|
protected void |
onCompileInternal()
Hook method that subclasses may override to react to compilation.
|
void |
setAccessCallParameterMetaData(boolean accessCallParameterMetaData)
Specify whether the parameter metadata for the call should be used.
|
void |
setCatalogName(java.lang.String catalogName)
Set the catalog name to use.
|
void |
setFunction(boolean function)
Specify whether this call is a function call.
|
void |
setInParameterNames(java.util.Set<java.lang.String> inParameterNames)
Set the names of in parameters to be used.
|
void |
setProcedureName(java.lang.String procedureName)
Set the name of the stored procedure.
|
void |
setReturnValueRequired(boolean returnValueRequired)
Specify whether the call requires a rerurn value.
|
void |
setSchemaName(java.lang.String schemaName)
Set the schema name to use.
|
protected final Log logger
protected AbstractJdbcCall(javax.sql.DataSource dataSource)
DataSource
.dataSource
- the DataSource to be usedprotected AbstractJdbcCall(JdbcTemplate jdbcTemplate)
JdbcTemplate
.jdbcTemplate
- the JdbcTemplate to usepublic JdbcTemplate getJdbcTemplate()
JdbcTemplate
.public void setProcedureName(java.lang.String procedureName)
public java.lang.String getProcedureName()
public void setInParameterNames(java.util.Set<java.lang.String> inParameterNames)
public java.util.Set<java.lang.String> getInParameterNames()
public void setCatalogName(java.lang.String catalogName)
public java.lang.String getCatalogName()
public void setSchemaName(java.lang.String schemaName)
public java.lang.String getSchemaName()
public void setFunction(boolean function)
public boolean isFunction()
public void setReturnValueRequired(boolean returnValueRequired)
public boolean isReturnValueRequired()
public void setAccessCallParameterMetaData(boolean accessCallParameterMetaData)
public java.lang.String getCallString()
protected CallableStatementCreatorFactory getCallableStatementFactory()
CallableStatementCreatorFactory
being usedpublic void addDeclaredParameter(SqlParameter parameter)
SqlParameter
and SqlInOutParameter
will be used to provide input values. This is different from the StoredProcedure
class
which for backwards compatibility reasons allows input values to be provided for parameters declared
as SqlOutParameter
.parameter
- the SqlParameter
to addpublic void addDeclaredRowMapper(java.lang.String parameterName, RowMapper<?> rowMapper)
RowMapper
for the specified parameter or column.parameterName
- name of parameter or columnrowMapper
- the RowMapper implementation to usepublic final void compile() throws InvalidDataAccessApiUsageException
InvalidDataAccessApiUsageException
- if the object hasn't
been correctly initialized, for example if no DataSource has been providedprotected void compileInternal()
protected void onCompileInternal()
public boolean isCompiled()
protected void checkCompiled()
Automatically called by doExecute
.
protected java.util.Map<java.lang.String,java.lang.Object> doExecute(SqlParameterSource parameterSource)
SqlParameterSource
parameterSource
- parameter names and values to be used in callprotected java.util.Map<java.lang.String,java.lang.Object> doExecute(java.lang.Object[] args)
args
- array of parameter values; order must match the order declared for the stored procedureprotected java.util.Map<java.lang.String,java.lang.Object> doExecute(java.util.Map<java.lang.String,?> args)
args
- Map of parameter name and valuesprotected java.lang.String getScalarOutParameterName()
protected java.util.List<SqlParameter> getCallParameters()
protected java.util.Map<java.lang.String,java.lang.Object> matchInParameterValuesWithCallParameters(SqlParameterSource parameterSource)
parameterSource
- the parameter vakues provided as a SqlParameterSource
protected java.util.Map<java.lang.String,?> matchInParameterValuesWithCallParameters(java.util.Map<java.lang.String,?> args)
args
- the parameter values provided in a Map