T - the generic type of the implementing typepublic abstract class ParameterizedStatementDefinition<T extends ParameterizedStatementDefinition> extends StatementDefinition<T>
StatementDefinition implementations which have a Map of input parameters.| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Object> |
inputParameters
A
Map which keys are the name of an input parameter to be set on the JDBC prepared statement. |
sql| Constructor and Description |
|---|
ParameterizedStatementDefinition() |
| Modifier and Type | Method and Description |
|---|---|
void |
addInputParameter(String paramName,
Object value)
Adds a new input parameter
|
protected T |
copy()
Returns a shallow copy of
this instance. |
protected Optional<Object> |
findParameter(Map<String,Object> parameters,
String name) |
Optional<Object> |
getInputParameter(String name)
Optionally returns a parameter of the given
name |
Map<String,Object> |
getInputParameters() |
Map<String,Object> |
getParameterValues()
Returns a
Map which keys are the names of the input parameters and the values are its values |
T |
resolveFromTemplate()
Returns an instance of the same class which state has been derived from the state of the
StatementDefinition.getTemplate() and the state
of this instance. |
getParameterType, getParameterTypes, getSql, getTemplate, setSqlcopyInto, getFetchSize, getMaxRows, getQueryTimeout, getQueryTimeoutUnit@Parameter
@Optional(defaultValue="#[{}]")
@Example(value="#[{\'name\': \"Max\", \'nickname\': \"The Mule\", \'company\': \"MuleSoft\"}]")
@Content
@Placement(order=2)
@TypeResolver(value=DbInputMetadataResolver.class)
protected Map<String,Object> inputParameters
Map which keys are the name of an input parameter to be set on the JDBC prepared statement.
Each parameter should
be referenced in the sql text using a semicolon prefix (E.g: where id = :myParamName)).
The map's values will contain the actual assignation for each parameter.
public Map<String,Object> getParameterValues()
Map which keys are the names of the input parameters and the values are its valuespublic Optional<Object> getInputParameter(String name)
namename - the name of the searched parameterOptional ParameterTypepublic Map<String,Object> getInputParameters()
Map with the input parameterspublic void addInputParameter(String paramName, Object value)
paramName - the parameter namevalue - the parameter valueprotected T copy()
StatementDefinitionthis instance.copy in class StatementDefinition<T extends ParameterizedStatementDefinition>public T resolveFromTemplate()
StatementDefinitionStatementDefinition.getTemplate() and the state
of this instance.
If StatementDefinition.getTemplate() is null then this instance is returned.
This method is recursive in the sense that the template can point to another template itself.
resolveFromTemplate in class StatementDefinition<T extends ParameterizedStatementDefinition>Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.