public abstract class NamedParameterUtils extends Object
Constructor and Description |
---|
NamedParameterUtils() |
Modifier and Type | Method and Description |
---|---|
static ParsedSql |
parseSqlStatement(String sql)
Parse the SQL statement and locate any placeholders or named parameters.
|
static String |
substituteNamedParameters(ParsedSql parsedSql,
Map<String,Object> paramSource)
Parse the SQL statement and locate any placeholders or named parameters.
|
static String |
substituteNamedParameters(String sql,
Map<String,Object> paramSource)
Parse the SQL statement and locate any placeholders or named parameters.
|
public static ParsedSql parseSqlStatement(String sql)
sql
- the SQL statementpublic static String substituteNamedParameters(String sql, Map<String,Object> paramSource)
This is a shortcut version of
#substituteNamedParameters(ParsedSql, SqlParameterSource)
.
sql
- the SQL statementparamSource
- the source for named parameterspublic static String substituteNamedParameters(ParsedSql parsedSql, Map<String,Object> paramSource)
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 statementparamSource
- the source for named parametersparseSqlStatement(java.lang.String)
Copyright © 2006–2018 TinyGroup. All rights reserved.