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.
NOTE: An instance of this class is thread-safe once configured.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CACHE_LIMIT
Default maximum number of entries for the SQL cache: 256.
|
Modifier and Type | Method and Description |
---|---|
static NamedParameterExpander |
disabled()
Creates a disabled instance of
NamedParameterExpander . |
static NamedParameterExpander |
enabled()
Creates a new enabled instance of
NamedParameterExpander . |
int |
getCacheLimit()
Return the maximum number of entries for the SQL cache.
|
protected org.springframework.data.r2dbc.core.ParsedSql |
getParsedSql(String sql)
Obtain a parsed representation of the given SQL statement.
|
void |
setCacheLimit(int cacheLimit)
Specify the maximum number of entries for the SQL cache.
|
public static final int DEFAULT_CACHE_LIMIT
public static NamedParameterExpander disabled()
NamedParameterExpander
.NamedParameterExpander
.public static NamedParameterExpander enabled()
NamedParameterExpander
.NamedParameterExpander
.public void setCacheLimit(int cacheLimit)
public int getCacheLimit()
protected org.springframework.data.r2dbc.core.ParsedSql getParsedSql(String sql)
The default implementation uses an LRU cache with an upper limit of 256 entries.
sql
- the original SQL statementCopyright © 2018–2019 Pivotal Software, Inc.. All rights reserved.