Only intended for internal use within Spring's R2DBC framework.
References to the same parameter name are substituted with
the same bind marker placeholder if a BindMarkersFactory uses
identifiable
placeholders.
| Modifier and Type | Class and Description |
|---|---|
| private static class | NamedParameterUtils.
Expanded query that allows binding of parameters using parameter names that were used to expand the query. |
| pack-priv static class | NamedParameterUtils.
Holder for bind markers progress. |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final String | PARAMETER_SEPARATORS
Set of characters that qualify as parameter separators, indicating that a parameter name in an SQL String has ended. |
| private static final boolean[] | separatorIndex
An index with separator flags per character code. |
| private static final String[] | START_SKIP
Set of characters that qualify as comment or quotes starting characters. |
| private static final String[] | STOP_SKIP
Set of characters that at are the corresponding comment or quotes ending characters. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private static int | addNamedParameter(List<NamedParameterUtils.
|
| private static int | |
| private static boolean | isParameterSeparator(char c)
Determine whether a parameter name ends at the current position, that is, whether the given character qualifies as a separator. |
| public static ParsedSql | Returns: the parsed statement, represented asParsedSql instancethe SQL statement sql)Parse the SQL statement and locate any placeholders or named parameters. |
| private static int | Returns: next position to process after any comments or quotes are skippedcharacter array containing SQL statement statement, int current position of statement position)Skip over comments and quoted names present in an SQL statement. |
| public static PreparedOperation | Returns: the expanded query that accepts bind parameters and allows for execution without further translationthe parsed representation of the SQL statement parsedSql, BindMarkersFactory the bind marker factory. bindMarkersFactory, BindParameterSource the source for named parameters paramSource)Parse the SQL statement and locate any placeholders or named parameters. |
| public static PreparedOperation | Returns: the expanded query that accepts bind parameters and allows for execution without further translationthe SQL statement sql, BindMarkersFactory the bind marker factory bindMarkersFactory, BindParameterSource the source for named parameters paramSource)Parse the SQL statement and locate any placeholders or named parameters. |
| PARAMETER_SEPARATORS | back to summary |
|---|---|
| private static final String PARAMETER_SEPARATORS Set of characters that qualify as parameter separators, indicating that a parameter name in an SQL String has ended. | |
| separatorIndex | back to summary |
|---|---|
| private static final boolean[] separatorIndex An index with separator flags per character code. Technically only needed between 34 and 124 at this point. | |
| START_SKIP | back to summary |
|---|---|
| private static final String[] START_SKIP Set of characters that qualify as comment or quotes starting characters. | |
| STOP_SKIP | back to summary |
|---|---|
| private static final String[] STOP_SKIP Set of characters that at are the corresponding comment or quotes ending characters. | |
| NamedParameterUtils | back to summary |
|---|---|
| pack-priv NamedParameterUtils() | |
| addNamedParameter | back to summary |
|---|---|
| private static int addNamedParameter(List<NamedParameterUtils. | |
| addNewNamedParameter | back to summary |
|---|---|
| private static int addNewNamedParameter(Set<String> namedParameters, int namedParameterCount, String parameter) | |
| isParameterSeparator | back to summary |
|---|---|
| private static boolean isParameterSeparator(char c) Determine whether a parameter name ends at the current position, that is, whether the given character qualifies as a separator. | |
| parseSqlStatement | back to summary |
|---|---|
| public static ParsedSql parseSqlStatement(String sql) Parse the SQL statement and locate any placeholders or named parameters. Named parameters are substituted for an R2DBC placeholder. | |
| skipCommentsAndQuotes | back to summary |
|---|---|
| private static int skipCommentsAndQuotes(char[] statement, int position) Skip over comments and quoted names present in an SQL statement.
| |
| substituteNamedParameters | back to summary |
|---|---|
| public static PreparedOperation Parse the SQL statement and locate any placeholders or named parameters. Named
parameters are substituted for an R2DBC 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 parentheses.
This allows for the use of "expression lists" in the SQL statement like:
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.
| |
| substituteNamedParameters | back to summary |
|---|---|
| public static PreparedOperation Parse the SQL statement and locate any placeholders or named parameters. Named parameters are substituted for a native placeholder and any select list is expanded to the required number of placeholders.
| |
Collections and nested arrays.
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final NamedParameterUtils. | |
| private final BindParameterSource |
| Access | Constructor and Description |
|---|---|
| pack-priv | ExpandedQuery(String expandedSql, NamedParameterUtils.
|
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private void | |
| public void | |
| public void | bindTo(BindTarget
the target to apply bindings to target)Implements org. Apply bindings to the supplied |
| pack-priv List | |
| public String | getSource()
Implements org. Get the underlying query source. |
| public String | toQuery()
Implements org. Return the string-representation of this operation to
be used with |
| expandedSql | back to summary |
|---|---|
| private final String expandedSql | |
| parameters | back to summary |
|---|---|
| private final NamedParameterUtils. | |
| parameterSource | back to summary |
|---|---|
| private final BindParameterSource parameterSource | |
| ExpandedQuery | back to summary |
|---|---|
| pack-priv ExpandedQuery(String expandedSql, NamedParameterUtils. | |
| bind | back to summary |
|---|---|
public void bind(BindTarget target, String identifier, Parameter parameter)
| |
| bind | back to summary |
|---|---|
| private void bind(BindTarget target, Iterator<BindMarker> markers, Object valueToBind) | |
| bindNull | back to summary |
|---|---|
| public void bindNull(BindTarget target, String identifier, Parameter parameter) | |
| bindTo | back to summary |
|---|---|
| public void bindTo(BindTarget target) Implements org. Doc from org. Apply bindings to the supplied
| |
| getBindMarkers | back to summary |
|---|---|
pack-priv List
| |
| getSource | back to summary |
|---|---|
| public String getSource() Implements org. Doc from org. Get the underlying query source. | |
| toQuery | back to summary |
|---|---|
| public String toQuery() Implements org. Doc from org. Return the string-representation of this operation to
be used with | |
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class |
| Modifier and Type | Field and Description |
|---|---|
| private final BindMarkers | |
| private final boolean | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv List | |
| pack-priv NamedParameterUtils. | Returns: the named parameterthe parameter name namedParameter)Get the |
| bindMarkers | back to summary |
|---|---|
| private final BindMarkers bindMarkers | |
| identifiable | back to summary |
|---|---|
| private final boolean identifiable | |
| references | back to summary |
|---|---|
| private final Map<String, List<NamedParameterUtils. | |
| NamedParameters | back to summary |
|---|---|
| pack-priv NamedParameters(BindMarkersFactory factory) | |
| getMarker | back to summary |
|---|---|
pack-priv List
| |
| getOrCreate | back to summary |
|---|---|
| pack-priv NamedParameterUtils. Get the
| |
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final List |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv String | Returns: the placeholder to be used in the SQL statementCreate a placeholder to translate a single value into a bindable parameter. |
| pack-priv String | |
| pack-priv String |
| namedParameter | back to summary |
|---|---|
| private final String namedParameter | |
| placeholders | back to summary |
|---|---|
| private final List<BindMarker> placeholders | |
| NamedParameter | back to summary |
|---|---|
| pack-priv NamedParameter(String namedParameter) | |
| addPlaceholder | back to summary |
|---|---|
| pack-priv String addPlaceholder() Create a placeholder to translate a single value into a bindable parameter. Can be called multiple times to create placeholders for array/collections.
| |
| getPlaceholder | back to summary |
|---|---|
| pack-priv String getPlaceholder() | |
| getPlaceholder | back to summary |
|---|---|
| pack-priv String getPlaceholder(int counter) | |
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final String | |
| private final int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. Indicates whether some other object is "equal to" this one. |
| pack-priv int | |
| pack-priv String | |
| pack-priv int | |
| public int |
| endIndex | back to summary |
|---|---|
| private final int endIndex | |
| parameterName | back to summary |
|---|---|
| private final String parameterName | |
| startIndex | back to summary |
|---|---|
| private final int startIndex | |
| ParameterHolder | back to summary |
|---|---|
| pack-priv ParameterHolder(String parameterName, int startIndex, int endIndex) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getEndIndex | back to summary |
|---|---|
| pack-priv int getEndIndex() | |
| getParameterName | back to summary |
|---|---|
| pack-priv String getParameterName() | |
| getStartIndex | back to summary |
|---|---|
| pack-priv int getStartIndex() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |