| java.lang.Object org.springframework.jdbc.core.namedparam.NamedParameterUtils
NamedParameterUtils | abstract public class NamedParameterUtils (Code) | | Helper methods for named parameter parsing.
Only intended for internal use within Spring's JDBC framework.
author: Thomas Risberg author: Juergen Hoeller since: 2.0 |
buildSqlTypeArray | static int[] buildSqlTypeArray(ParsedSql parsedSql, SqlParameterSource paramSource)(Code) | | Convert a Map of parameter types to 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.
Parameters: parsedSql - the parsed SQL statement Parameters: paramSource - the source for named parameters |
buildValueArray | public static Object[] buildValueArray(ParsedSql parsedSql, SqlParameterSource paramSource, List declaredParams)(Code) | | Convert a Map of named parameter values to a corresponding array.
Parameters: parsedSql - the parsed SQL statement Parameters: paramSource - the source for named parameters Parameters: declaredParams - the List of declared SqlParameter objects(may be null ). If specified, the parameter metadata willbe built into the value array in the form of SqlParameterValue objects. the array of values |
parseSqlStatement | public static ParsedSql parseSqlStatement(String sql)(Code) | | Parse the SQL statement and locate any placeholders or named parameters.
Named parameters are substituted for a JDBC placeholder.
Parameters: sql - the SQL statement the parsed statement, represented as ParsedSql instance |
substituteNamedParameters | public static String substituteNamedParameters(ParsedSql parsedSql, SqlParameterSource paramSource)(Code) | | 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.
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.
Parameters: parsedSql - the parsed represenation of the SQL statement Parameters: paramSource - the source for named parameters the SQL statement with substituted parameters See Also: NamedParameterUtils.parseSqlStatement |
substituteNamedParameters | public static String substituteNamedParameters(String sql, SqlParameterSource paramSource)(Code) | | 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
NamedParameterUtils.substituteNamedParameters(ParsedSql,SqlParameterSource) .
Parameters: sql - the SQL statement Parameters: paramSource - the source for named parameters the SQL statement with substituted parameters |
|
|