@Deprecated public class NamedParameterExpander extends Object
This class expands SQL from named parameters to native style placeholders at execution time. It also allows for
expanding a List
of values to the appropriate number of placeholders.
References to the same parameter name are substituted with the same bind marker placeholder if a
BindMarkersFactory
uses identifiable
placeholders.
NOTE: An instance of this class is thread-safe once configured.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CACHE_LIMIT
Deprecated.
Default maximum number of entries for the SQL cache: 256.
|
Constructor and Description |
---|
NamedParameterExpander()
Deprecated.
Create a new enabled instance of
NamedParameterExpander . |
Modifier and Type | Method and Description |
---|---|
PreparedOperation<String> |
expand(String sql,
BindMarkersFactory bindMarkersFactory,
BindParameterSource paramSource)
Deprecated.
Parse the SQL statement and locate any placeholders or named parameters.
|
int |
getCacheLimit()
Deprecated.
Return the maximum number of entries for the SQL cache.
|
List<String> |
getParameterNames(String sql)
Deprecated.
Parse the SQL statement and locate any placeholders or named parameters.
|
void |
setCacheLimit(int cacheLimit)
Deprecated.
Specify the maximum number of entries for the SQL cache.
|
public static final int DEFAULT_CACHE_LIMIT
public NamedParameterExpander()
NamedParameterExpander
.public void setCacheLimit(int cacheLimit)
public int getCacheLimit()
public PreparedOperation<String> expand(String sql, BindMarkersFactory bindMarkersFactory, BindParameterSource paramSource)
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 placeholders to be used for a select list. Select lists should be limited to 100 or fewer elements. A larger number of elements is not guaranteed to be supported by the database and is strictly vendor-dependent.
sql
- sql the original SQL statementbindMarkersFactory
- the bind marker factory.paramSource
- the source for named parameters.PreparedOperation
.Copyright © 2018–2022 Pivotal Software, Inc.. All rights reserved.