public class CallMetaDataContext extends Object
Constructor and Description |
---|
CallMetaDataContext() |
Modifier and Type | Method and Description |
---|---|
String |
createCallString()
Build the call string based on configuration and meta-data information.
|
protected String |
createParameterBinding(SqlParameter parameter)
Build the parameter binding fragment.
|
SqlParameter |
createReturnResultSetParameter(String parameterName,
RowMapper<?> rowMapper)
Create a ReturnResultSetParameter/SqlOutParameter depending on the support provided
by the JDBC driver used for the database in use.
|
List<SqlParameter> |
getCallParameters()
Get the List of SqlParameter objects to be used in call execution.
|
String |
getCatalogName()
Get the name of the catalog.
|
String |
getFunctionReturnName()
Get the name used for the return value of the function.
|
Set<String> |
getLimitedInParameterNames()
Get a limited set of in parameters to be used.
|
List<String> |
getOutParameterNames()
Get a list of the out parameter names.
|
String |
getProcedureName()
Get the name of the procedure.
|
String |
getScalarOutParameterName()
Get the name of the single out parameter for this call.
|
String |
getSchemaName()
Get the name of the schema.
|
void |
initializeMetaData(DataSource dataSource)
Initialize this class with meta-data from the database.
|
boolean |
isAccessCallParameterMetaData()
Check whether call parameter meta-data should be accessed.
|
boolean |
isFunction()
Check whether this call is a function call.
|
boolean |
isNamedBinding()
Check whether parameters should be bound by name.
|
boolean |
isReturnValueRequired()
Check whether a return value is required.
|
Map<String,?> |
matchInParameterValuesWithCallParameters(Map<String,?> inParameters)
Match input parameter values with the parameters declared to be used in the call.
|
Map<String,?> |
matchInParameterValuesWithCallParameters(Object[] parameterValues) |
Map<String,Object> |
matchInParameterValuesWithCallParameters(SqlParameterSource parameterSource)
Match input parameter values with the parameters declared to be used in the call.
|
void |
processParameters(List<SqlParameter> parameters)
Process the list of parameters provided, and if procedure column meta-data is used,
the parameters will be matched against the meta-data information and any missing
ones will be automatically included.
|
protected List<SqlParameter> |
reconcileParameters(List<SqlParameter> parameters)
Reconcile the provided parameters with available meta-data and add new ones where appropriate.
|
void |
setAccessCallParameterMetaData(boolean accessCallParameterMetaData)
Specify whether call parameter meta-data should be accessed.
|
void |
setCatalogName(String catalogName)
Specify the name of the catalog.
|
void |
setFunction(boolean function)
Specify whether this call is a function call.
|
void |
setFunctionReturnName(String functionReturnName)
Specify the name used for the return value of the function.
|
void |
setLimitedInParameterNames(Set<String> limitedInParameterNames)
Specify a limited set of in parameters to be used.
|
void |
setNamedBinding(boolean namedBinding)
Specify whether parameters should be bound by name.
|
void |
setOutParameterNames(List<String> outParameterNames)
Specify the names of the out parameters.
|
void |
setProcedureName(String procedureName)
Specify the name of the procedure.
|
void |
setReturnValueRequired(boolean returnValueRequired)
Specify whether a return value is required.
|
void |
setSchemaName(String schemaName)
Specify the name of the schema.
|
protected final Log logger
public void setFunctionReturnName(String functionReturnName)
public String getFunctionReturnName()
public void setLimitedInParameterNames(Set<String> limitedInParameterNames)
public Set<String> getLimitedInParameterNames()
public void setOutParameterNames(List<String> outParameterNames)
public List<String> getOutParameterNames()
public void setProcedureName(@Nullable String procedureName)
public void setCatalogName(@Nullable String catalogName)
public void setSchemaName(@Nullable String schemaName)
public void setFunction(boolean function)
public boolean isFunction()
public void setReturnValueRequired(boolean returnValueRequired)
public boolean isReturnValueRequired()
public void setAccessCallParameterMetaData(boolean accessCallParameterMetaData)
public boolean isAccessCallParameterMetaData()
public void setNamedBinding(boolean namedBinding)
public boolean isNamedBinding()
public void initializeMetaData(DataSource dataSource)
dataSource
- the DataSource used to retrieve meta-datapublic SqlParameter createReturnResultSetParameter(String parameterName, RowMapper<?> rowMapper)
parameterName
- the name of the parameter (also used as the name of the List returned in the output)rowMapper
- a RowMapper implementation used to map the data returned in the result set@Nullable public String getScalarOutParameterName()
public List<SqlParameter> getCallParameters()
public void processParameters(List<SqlParameter> parameters)
parameters
- the list of parameters to use as a baseprotected List<SqlParameter> reconcileParameters(List<SqlParameter> parameters)
public Map<String,Object> matchInParameterValuesWithCallParameters(SqlParameterSource parameterSource)
parameterSource
- the input valuespublic Map<String,?> matchInParameterValuesWithCallParameters(Map<String,?> inParameters)
inParameters
- the input valuespublic Map<String,?> matchInParameterValuesWithCallParameters(Object[] parameterValues)
public String createCallString()
protected String createParameterBinding(SqlParameter parameter)
parameter
- call parameter