spring-framework / org.springframework.jdbc.core.namedparam / SqlParameterSourceUtils

SqlParameterSourceUtils

abstract class SqlParameterSourceUtils

Class that provides helper methods for the use of SqlParameterSource, in particular with NamedParameterJdbcTemplate.

Author
Thomas Risberg

Author
Juergen Hoeller

Since
2.5

Constructors

<init>

SqlParameterSourceUtils()

Class that provides helper methods for the use of SqlParameterSource, in particular with NamedParameterJdbcTemplate.

Functions

createBatch

open static fun createBatch(vararg candidates: Any): Array<SqlParameterSource>
open static fun createBatch(candidates: MutableCollection<*>): Array<SqlParameterSource>

Create an array of 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.

open static fun createBatch(valueMaps: Array<MutableMap<String, *>>): Array<SqlParameterSource>

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

extractCaseInsensitiveParameterNames

open static fun extractCaseInsensitiveParameterNames(parameterSource: SqlParameterSource): MutableMap<String, String>

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

getTypedValue

open static fun getTypedValue(source: SqlParameterSource, parameterName: String): Any

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