public class

SqlParameterSourceUtils

extends Object
java.lang.Object
   ↳ org.springframework.jdbc.core.namedparam.SqlParameterSourceUtils

Class Overview

Class that provides helper methods for the use of SqlParameterSource with SimpleJdbc classes.

Summary

Public Constructors
SqlParameterSourceUtils()
Public Methods
static SqlParameterSource[] createBatch(Object[] beans)
Create an array of BeanPropertySqlParameterSource objects populated with data from the values passed in.
static SqlParameterSource[] createBatch(Map[] valueMaps)
Create an array of MapSqlParameterSource objects populated with data from the values passed in.
static Map 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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public SqlParameterSourceUtils ()

Public Methods

public static SqlParameterSource[] createBatch (Object[] beans)

Create an array of BeanPropertySqlParameterSource objects populated with data from the values passed in. This will define what is included in a batch operation.

Parameters
beans object array of beans containing the values to be used
Returns
  • an array of SqlParameterSource

public static SqlParameterSource[] createBatch (Map[] valueMaps)

Create an array of MapSqlParameterSource objects populated with data from the values passed in. This will define what is included in a batch operation.

Parameters
valueMaps array of Maps containing the values to be used
Returns
  • an array of SqlParameterSource

public static Map extractCaseInsensitiveParameterNames (SqlParameterSource parameterSource)

Create a Map of case insensitive parameter names together with the original name.

Parameters
parameterSource the source of paramer names
Returns
  • the Map that can be used for case insensitive matching of parameter names

public static Object getTypedValue (SqlParameterSource source, String parameterName)

Create a wrapped value if parameter has type information, plain object if not.

Parameters
source the source of paramer values and type information
parameterName the name of the parameter
Returns
  • the value object