public abstract class SqlParameterSourceUtils extends Object
SqlParameterSource
,
in particular with NamedParameterJdbcTemplate
.Constructor and Description |
---|
SqlParameterSourceUtils() |
Modifier and Type | Method and Description |
---|---|
static SqlParameterSource[] |
createBatch(Collection<?> candidates)
Create an array of
SqlParameterSource objects populated with data
from the values passed in (either a Map or a bean object). |
static SqlParameterSource[] |
createBatch(Map<String,?>[] valueMaps)
Create an array of
MapSqlParameterSource objects populated with data from
the values passed in. |
static SqlParameterSource[] |
createBatch(Object... candidates)
Create an array of
SqlParameterSource objects populated with data
from the values passed in (either a Map or a bean object). |
static Map<String,String> |
extractCaseInsensitiveParameterNames(SqlParameterSource parameterSource)
Create a Map of case insensitive parameter names together with the original name.
|
static Object |
getTypedValue(SqlParameterSource source,
String parameterName)
Create a wrapped value if parameter has type information, plain object if not.
|
public static SqlParameterSource[] createBatch(Object... candidates)
SqlParameterSource
objects populated with data
from the values passed in (either a Map
or a bean object).
This will define what is included in a batch operation.candidates
- object array of objects containing the values to be usedSqlParameterSource
MapSqlParameterSource
,
BeanPropertySqlParameterSource
,
NamedParameterJdbcTemplate.batchUpdate(String, SqlParameterSource[])
public static SqlParameterSource[] createBatch(Collection<?> candidates)
SqlParameterSource
objects populated with data
from the values passed in (either a Map
or a bean object).
This will define what is included in a batch operation.candidates
- collection of objects containing the values to be usedSqlParameterSource
MapSqlParameterSource
,
BeanPropertySqlParameterSource
,
NamedParameterJdbcTemplate.batchUpdate(String, SqlParameterSource[])
public static SqlParameterSource[] createBatch(Map<String,?>[] valueMaps)
MapSqlParameterSource
objects populated with data from
the values passed in. This will define what is included in a batch operation.valueMaps
- array of Map
instances containing the values to be usedSqlParameterSource
MapSqlParameterSource
,
NamedParameterJdbcTemplate.batchUpdate(String, Map[])
@Nullable public static Object getTypedValue(SqlParameterSource source, String parameterName)
source
- the source of parameter values and type informationparameterName
- the name of the parameterSqlParameterValue
public static Map<String,String> extractCaseInsensitiveParameterNames(SqlParameterSource parameterSource)
parameterSource
- the source of parameter names