java.lang.Object | |
↳ | org.springframework.jdbc.core.namedparam.NamedParameterUtils |
Helper methods for named parameter parsing. Only intended for internal use within Spring's JDBC framework.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Convert parameter declarations from an SqlParameterSource to a corresponding List of SqlParameters.
| |||||||||||
Convert parameter types from an SqlParameterSource into a corresponding int array.
| |||||||||||
Convert a Map of named parameter values to a corresponding array.
| |||||||||||
Convert a Map of named parameter values to a corresponding array.
| |||||||||||
Parse the SQL statement and locate any placeholders or named parameters.
| |||||||||||
Parse the SQL statement and locate any placeholders or named parameters.
| |||||||||||
Parse the SQL statement and locate any placeholders or named parameters.
| |||||||||||
Parse the SQL statement and locate any placeholders or named parameters.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Convert parameter declarations from an SqlParameterSource to a corresponding List of SqlParameters. This is necessary in order to reuse existing methods on JdbcTemplate. The SqlParameter for a named parameter is placed in the correct position in the resulting list based on the parsed SQL statement info.
parsedSql | the parsed SQL statement |
---|---|
paramSource | the source for named parameters |
Convert parameter types from an SqlParameterSource into a corresponding int array. This is necessary in order to reuse existing methods on JdbcTemplate. Any named parameter types are placed in the correct position in the Object array based on the parsed SQL statement info.
parsedSql | the parsed SQL statement |
---|---|
paramSource | the source for named parameters |
Convert a Map of named parameter values to a corresponding array.
parsedSql | the parsed SQL statement |
---|---|
paramSource | the source for named parameters |
declaredParams | the List of declared SqlParameter objects
(may be null ). If specified, the parameter metadata will
be built into the value array in the form of SqlParameterValue objects. |
Convert a Map of named parameter values to a corresponding array.
This is a shortcut version of
buildValueArray(ParsedSql, SqlParameterSource, java.util.List)
.
sql | the SQL statement |
---|---|
paramMap | the Map of parameters |
Parse the SQL statement and locate any placeholders or named parameters. Named parameters are substituted for a JDBC placeholder.
sql | the SQL statement |
---|
Parse the SQL statement and locate any placeholders or named parameters. Named parameters are substituted for a JDBC placeholder.
This is a shortcut version of
parseSqlStatement(String)
in combination with
substituteNamedParameters(ParsedSql, SqlParameterSource)
.
sql | the SQL statement |
---|
Parse the SQL statement and locate any placeholders or named parameters.
Named parameters are substituted for a JDBC placeholder and any select list
is expanded to the required number of placeholders. Select lists may contain
an array of objects and in that case the placeholders will be grouped and
enclosed with parantheses. This allows for the use of "expression lists" in
the SQL statement like:
select id, name, state from table where (name, age) in (('John', 35), ('Ann', 50))
The parameter values passed in are used to determine the number of placeholder to be used for a select list. Select lists should be limited to 100 or fewer elements. A larger number of elements is not guaramteed to be supported by the database and is strictly vendor-dependent.
parsedSql | the parsed represenation of the SQL statement |
---|---|
paramSource | the source for named parameters |
Parse the SQL statement and locate any placeholders or named parameters. Named parameters are substituted for a JDBC placeholder and any select list is expanded to the required number of placeholders.
This is a shortcut version of
substituteNamedParameters(ParsedSql, SqlParameterSource)
.
sql | the SQL statement |
---|---|
paramSource | the source for named parameters |