public class

CallMetaDataContext

extends Object
java.lang.Object
   ↳ org.springframework.jdbc.core.metadata.CallMetaDataContext

Class Overview

Class to manage context metadata used for the configuration and execution of the call.

Summary

Fields
protected final Log logger Logger available to subclasses
Public Constructors
CallMetaDataContext()
Public Methods
String createCallString()
Build the call string based on configuration and metadata information.
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 metadata from the database
boolean isAccessCallParameterMetaData()
Check whether call parameter metadata should be accessed.
boolean isFunction()
Check whether this call is a function call.
boolean isReturnValueRequired()
Check whether a return value is required.
Map<String, ?> matchInParameterValuesWithCallParameters(Object[] parameterValues)
Map<String, ?> matchInParameterValuesWithCallParameters(Map<String, ?> inParameters)
Match input parameter values with the parameters declared to be used in the call.
Map<StringObject> 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 metadata is used the parameters will be matched against the metadata information and any missing ones will be automatically included
void setAccessCallParameterMetaData(boolean accessCallParameterMetaData)
Specify whether call parameter metadata 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 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)
Secify the name of the schema.
Protected Methods
List<SqlParameter> reconcileParameters(List<SqlParameter> parameters)
Reconcile the provided parameters with available metadata and add new ones where appropriate
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected final Log logger

Logger available to subclasses

Public Constructors

public CallMetaDataContext ()

Public Methods

public String createCallString ()

Build the call string based on configuration and metadata information.

Returns
  • the call string to be used

public 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.

Parameters
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
Returns
  • the appropriate SqlParameter

public List<SqlParameter> getCallParameters ()

Get the List of SqlParameter objects to be used in call execution

public String getCatalogName ()

Get the name of the catalog.

public String getFunctionReturnName ()

Get the name used for the return value of the function.

public Set<String> getLimitedInParameterNames ()

Get a limited set of in parameters to be used.

public List<String> getOutParameterNames ()

Get a list of the out parameter names.

public String getProcedureName ()

Get the name of the procedure.

public String getScalarOutParameterName ()

Get the name of the single out parameter for this call. If there are multiple parameters then the name of the first one is returned.

public String getSchemaName ()

Get the name of the schema.

public void initializeMetaData (DataSource dataSource)

Initialize this class with metadata from the database

Parameters
dataSource the DataSource used to retrieve metadata

public boolean isAccessCallParameterMetaData ()

Check whether call parameter metadata should be accessed.

public boolean isFunction ()

Check whether this call is a function call.

public boolean isReturnValueRequired ()

Check whether a return value is required.

public Map<String, ?> matchInParameterValuesWithCallParameters (Object[] parameterValues)

public Map<String, ?> matchInParameterValuesWithCallParameters (Map<String, ?> inParameters)

Match input parameter values with the parameters declared to be used in the call.

Parameters
inParameters the input values
Returns
  • a Map containing the matched parameter names with the value taken from the input

public Map<StringObject> matchInParameterValuesWithCallParameters (SqlParameterSource parameterSource)

Match input parameter values with the parameters declared to be used in the call.

Parameters
parameterSource the input values
Returns
  • a Map containing the matched parameter names with the value taken from the input

public void processParameters (List<SqlParameter> parameters)

Process the list of parameters provided and if procedure column metadata is used the parameters will be matched against the metadata information and any missing ones will be automatically included

Parameters
parameters the list of parameters to use as a base

public void setAccessCallParameterMetaData (boolean accessCallParameterMetaData)

Specify whether call parameter metadata should be accessed.

public void setCatalogName (String catalogName)

Specify the name of the catalog.

public void setFunction (boolean function)

Specify whether this call is a function call.

public void setFunctionReturnName (String functionReturnName)

Specify the name used for the return value of the function.

public void setLimitedInParameterNames (Set<String> limitedInParameterNames)

Specify a limited set of in parameters to be used.

public void setOutParameterNames (List<String> outParameterNames)

Specify the names of the out parameters.

public void setProcedureName (String procedureName)

Specify the name of the procedure.

public void setReturnValueRequired (boolean returnValueRequired)

Specify whether a return value is required.

public void setSchemaName (String schemaName)

Secify the name of the schema.

Protected Methods

protected List<SqlParameter> reconcileParameters (List<SqlParameter> parameters)

Reconcile the provided parameters with available metadata and add new ones where appropriate