Top Description Fields Constructors Methods
org.springframework.r2dbc.core

pack-priv Class ParsedSql

extends Object
Class Inheritance
Imports
java.util.ArrayList, .List

Holds information about a parsed SQL statement.
Authors
Thomas Risberg, Juergen Hoeller
Since
5.3

Field Summary

Modifier and TypeField and Description
private int
private final String
private final List<int[]>
private final List<String>
private int
private int

Constructor Summary

AccessConstructor and Description
pack-priv
ParsedSql(String
the SQL statement that is being (or is to be) parsed
originalSql
)

Create a new instance of the ParsedSql class.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
addNamedParameter(String
the name of the parameter
parameterName
,
int
the start index in the original SQL String
startIndex
,
int
the end index in the original SQL String
endIndex
)

Add a named parameter parsed from this SQL statement.

pack-priv int
getNamedParameterCount()

Return the count of named parameters in the SQL statement.

pack-priv String
getOriginalSql()

Return the SQL statement that is being parsed.

pack-priv int[]

Returns:

the start index and end index, combined into an int array of length 2
getParameterIndexes
(int
the position of the parameter (as index in the parameter names List)
parameterPosition
)

Return the parameter indexes for the specified parameter.

pack-priv List<String>
getParameterNames()

Return all the parameters (bind variables) in the parsed SQL statement.

pack-priv int
getTotalParameterCount()

Return the total count of all the parameters in the SQL statement.

pack-priv int
getUnnamedParameterCount()

Return the count of all the unnamed parameters in the SQL statement.

pack-priv void
setNamedParameterCount(int namedParameterCount)

Set the count of named parameters in the SQL statement.

pack-priv void
setTotalParameterCount(int totalParameterCount)

Set the total count of all the parameters in the SQL statement.

pack-priv void
setUnnamedParameterCount(int unnamedParameterCount)

Set the count of all the unnamed parameters in the SQL statement.

public String
toString()

Overrides java.lang.Object.toString.

Exposes the original SQL String.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

namedParameterCountback to summary
private int namedParameterCount
originalSqlback to summary
private final String originalSql
parameterIndexesback to summary
private final List<int[]> parameterIndexes
parameterNamesback to summary
private final List<String> parameterNames
totalParameterCountback to summary
private int totalParameterCount
unnamedParameterCountback to summary
private int unnamedParameterCount

Constructor Detail

ParsedSqlback to summary
pack-priv ParsedSql(String originalSql)

Create a new instance of the ParsedSql class.

Parameters
originalSql:String

the SQL statement that is being (or is to be) parsed

Method Detail

addNamedParameterback to summary
pack-priv void addNamedParameter(String parameterName, int startIndex, int endIndex)

Add a named parameter parsed from this SQL statement.

Parameters
parameterName:String

the name of the parameter

startIndex:int

the start index in the original SQL String

endIndex:int

the end index in the original SQL String

getNamedParameterCountback to summary
pack-priv int getNamedParameterCount()

Return the count of named parameters in the SQL statement. Each parameter name counts once; repeated occurrences do not count here.

getOriginalSqlback to summary
pack-priv String getOriginalSql()

Return the SQL statement that is being parsed.

getParameterIndexesback to summary
pack-priv int[] getParameterIndexes(int parameterPosition)

Return the parameter indexes for the specified parameter.

Parameters
parameterPosition:int

the position of the parameter (as index in the parameter names List)

Returns:int[]

the start index and end index, combined into an int array of length 2

getParameterNamesback to summary
pack-priv List<String> getParameterNames()

Return all the parameters (bind variables) in the parsed SQL statement. Repeated occurrences of the same parameter name are included here.

getTotalParameterCountback to summary
pack-priv int getTotalParameterCount()

Return the total count of all the parameters in the SQL statement. Repeated occurrences of the same parameter name do count here.

getUnnamedParameterCountback to summary
pack-priv int getUnnamedParameterCount()

Return the count of all the unnamed parameters in the SQL statement.

setNamedParameterCountback to summary
pack-priv void setNamedParameterCount(int namedParameterCount)

Set the count of named parameters in the SQL statement. Each parameter name counts once; repeated occurrences do not count here.

setTotalParameterCountback to summary
pack-priv void setTotalParameterCount(int totalParameterCount)

Set the total count of all the parameters in the SQL statement. Repeated occurrences of the same parameter name do count here.

setUnnamedParameterCountback to summary
pack-priv void setUnnamedParameterCount(int unnamedParameterCount)

Set the count of all the unnamed parameters in the SQL statement.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Exposes the original SQL String.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

Annotations
@Override