public class CallMetaDataContext
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private boolean |
accessCallParameterMetaData
should we access call parameter meta data info or not
|
private java.lang.String |
actualFunctionReturnName
Actual name to use for the return value in the output map
|
private java.util.List<SqlParameter> |
callParameters
List of SqlParameter objects to be used in call execution
|
private java.lang.String |
catalogName
name of catalog for call
|
private java.lang.String |
defaultFunctionReturnName
Default name to use for the return value in the output map
|
private boolean |
function
indicates whether this is a procedure or a function
|
private java.util.Set<java.lang.String> |
limitedInParameterNames
Set of in parameter names to exclude use for any not listed
|
protected Log |
logger
Logger available to subclasses
|
private CallMetaDataProvider |
metaDataProvider
the provider of call meta data
|
private java.util.List<java.lang.String> |
outParameterNames
List of SqlParameter names for out parameters
|
private java.lang.String |
procedureName
name of procedure to call
|
private boolean |
returnValueRequired
indicates whether this procedure's return value should be included
|
private java.lang.String |
schemaName
name of schema for call
|
Constructor and Description |
---|
CallMetaDataContext() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
createCallString()
Build the call string based on configuration and metadata information.
|
SqlParameter |
createReturnResultSetParameter(java.lang.String parameterName,
RowMapper rowMapper)
Create a ReturnResultSetParameter/SqlOutParameter depending on the support provided
by the JDBC driver used for the database in use.
|
java.util.List<SqlParameter> |
getCallParameters()
Get the List of SqlParameter objects to be used in call execution.
|
java.lang.String |
getCatalogName()
Get the name of the catalog.
|
java.lang.String |
getFunctionReturnName()
Get the name used for the return value of the function.
|
java.util.Set<java.lang.String> |
getLimitedInParameterNames()
Get a limited set of in parameters to be used.
|
java.util.List<java.lang.String> |
getOutParameterNames()
Get a list of the out parameter names.
|
java.lang.String |
getProcedureName()
Get the name of the procedure.
|
java.lang.String |
getScalarOutParameterName()
Get the name of the single out parameter for this call.
|
java.lang.String |
getSchemaName()
Get the name of the schema.
|
void |
initializeMetaData(javax.sql.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.
|
java.util.Map<java.lang.String,?> |
matchInParameterValuesWithCallParameters(java.util.Map<java.lang.String,?> inParameters)
Match input parameter values with the parameters declared to be used in the call.
|
java.util.Map<java.lang.String,?> |
matchInParameterValuesWithCallParameters(java.lang.Object[] parameterValues) |
java.util.Map<java.lang.String,java.lang.Object> |
matchInParameterValuesWithCallParameters(SqlParameterSource parameterSource)
Match input parameter values with the parameters declared to be used in the call.
|
void |
processParameters(java.util.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.
|
protected java.util.List<SqlParameter> |
reconcileParameters(java.util.List<SqlParameter> parameters)
Reconcile the provided parameters with available metadata and add new ones where appropriate.
|
void |
setAccessCallParameterMetaData(boolean accessCallParameterMetaData)
Specify whether call parameter metadata should be accessed.
|
void |
setCatalogName(java.lang.String catalogName)
Specify the name of the catalog.
|
void |
setFunction(boolean function)
Specify whether this call is a function call.
|
void |
setFunctionReturnName(java.lang.String functionReturnName)
Specify the name used for the return value of the function.
|
void |
setLimitedInParameterNames(java.util.Set<java.lang.String> limitedInParameterNames)
Specify a limited set of in parameters to be used.
|
void |
setOutParameterNames(java.util.List<java.lang.String> outParameterNames)
Specify the names of the out parameters.
|
void |
setProcedureName(java.lang.String procedureName)
Specify the name of the procedure.
|
void |
setReturnValueRequired(boolean returnValueRequired)
Specify whether a return value is required.
|
void |
setSchemaName(java.lang.String schemaName)
Secify the name of the schema.
|
protected final Log logger
private java.lang.String procedureName
private java.lang.String catalogName
private java.lang.String schemaName
private java.util.List<SqlParameter> callParameters
private java.lang.String defaultFunctionReturnName
private java.lang.String actualFunctionReturnName
private java.util.Set<java.lang.String> limitedInParameterNames
private java.util.List<java.lang.String> outParameterNames
private boolean accessCallParameterMetaData
private boolean function
private boolean returnValueRequired
private CallMetaDataProvider metaDataProvider
public void setFunctionReturnName(java.lang.String functionReturnName)
public java.lang.String getFunctionReturnName()
public void setLimitedInParameterNames(java.util.Set<java.lang.String> limitedInParameterNames)
public java.util.Set<java.lang.String> getLimitedInParameterNames()
public void setOutParameterNames(java.util.List<java.lang.String> outParameterNames)
public java.util.List<java.lang.String> getOutParameterNames()
public void setProcedureName(java.lang.String procedureName)
public java.lang.String getProcedureName()
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 boolean isAccessCallParameterMetaData()
public SqlParameter createReturnResultSetParameter(java.lang.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 setpublic java.lang.String getScalarOutParameterName()
public java.util.List<SqlParameter> getCallParameters()
public void initializeMetaData(javax.sql.DataSource dataSource)
dataSource
- the DataSource used to retrieve metadatapublic void processParameters(java.util.List<SqlParameter> parameters)
parameters
- the list of parameters to use as a baseprotected java.util.List<SqlParameter> reconcileParameters(java.util.List<SqlParameter> parameters)
public java.util.Map<java.lang.String,java.lang.Object> matchInParameterValuesWithCallParameters(SqlParameterSource parameterSource)
parameterSource
- the input valuespublic java.util.Map<java.lang.String,?> matchInParameterValuesWithCallParameters(java.util.Map<java.lang.String,?> inParameters)
inParameters
- the input valuespublic java.util.Map<java.lang.String,?> matchInParameterValuesWithCallParameters(java.lang.Object[] parameterValues)
public java.lang.String createCallString()