public class ParsedSql
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
namedParameterCount |
private java.lang.String |
originalSql |
private java.util.List<int[]> |
parameterIndexes |
private java.util.List<java.lang.String> |
parameterNames |
private int |
totalParameterCount |
private int |
unnamedParameterCount |
Constructor and Description |
---|
ParsedSql(java.lang.String originalSql)
Create a new instance of the
ParsedSql class. |
Modifier and Type | Method and Description |
---|---|
(package private) void |
addNamedParameter(java.lang.String parameterName,
int startIndex,
int endIndex)
Add a named parameter parsed from this SQL statement.
|
(package private) int |
getNamedParameterCount()
Return the count of named parameters in the SQL statement.
|
(package private) java.lang.String |
getOriginalSql()
Return the SQL statement that is being parsed.
|
(package private) int[] |
getParameterIndexes(int parameterPosition)
Return the parameter indexes for the specified parameter.
|
(package private) java.util.List<java.lang.String> |
getParameterNames()
Return all of the parameters (bind variables) in the parsed SQL statement.
|
(package private) int |
getTotalParameterCount()
Return the total count of all of the parameters in the SQL statement.
|
(package private) int |
getUnnamedParameterCount()
Return the count of all of the unnamed parameters in the SQL statement.
|
(package private) void |
setNamedParameterCount(int namedParameterCount)
Set the count of named parameters in the SQL statement.
|
(package private) void |
setTotalParameterCount(int totalParameterCount)
Set the total count of all of the parameters in the SQL statement.
|
(package private) void |
setUnnamedParameterCount(int unnamedParameterCount)
Set the count of all of the unnamed parameters in the SQL statement.
|
java.lang.String |
toString()
Exposes the original SQL String.
|
private java.lang.String originalSql
private java.util.List<java.lang.String> parameterNames
private java.util.List<int[]> parameterIndexes
private int namedParameterCount
private int unnamedParameterCount
private int totalParameterCount
ParsedSql(java.lang.String originalSql)
ParsedSql
class.originalSql
- the SQL statement that is being (or is to be) parsedjava.lang.String getOriginalSql()
void addNamedParameter(java.lang.String parameterName, int startIndex, int endIndex)
parameterName
- the name of the parameterstartIndex
- the start index in the original SQL StringendIndex
- the end index in the original SQL Stringjava.util.List<java.lang.String> getParameterNames()
int[] getParameterIndexes(int parameterPosition)
parameterPosition
- the position of the parameter
(as index in the parameter names List)void setNamedParameterCount(int namedParameterCount)
int getNamedParameterCount()
void setUnnamedParameterCount(int unnamedParameterCount)
int getUnnamedParameterCount()
void setTotalParameterCount(int totalParameterCount)
int getTotalParameterCount()
public java.lang.String toString()
toString
in class java.lang.Object