net.hasor.jdbc.core.util
类 ParsedSql

java.lang.Object
  继承者 net.hasor.jdbc.core.util.ParsedSql

public class ParsedSql
extends Object

Holds information about a parsed SQL statement.

从以下版本开始:
2.0
作者:
Thomas Risberg, Juergen Hoeller

构造方法摘要
ParsedSql(String originalSql)
          Create a new instance of the ParsedSql class.
 
方法摘要
 void addNamedParameter(String parameterName, int startIndex, int endIndex)
          Add a named parameter parsed from this SQL statement.
 int getNamedParameterCount()
          Return the count of named parameters in the SQL statement.
 String getOriginalSql()
          Return the SQL statement that is being parsed.
 int[] getParameterIndexes(int parameterPosition)
          Return the parameter indexes for the specified parameter.
 List<String> getParameterNames()
          Return all of the parameters (bind variables) in the parsed SQL statement.
 int getTotalParameterCount()
          Return the total count of all of the parameters in the SQL statement.
 int getUnnamedParameterCount()
          Return the count of all of the unnamed parameters in the SQL statement.
 void setNamedParameterCount(int namedParameterCount)
          Set the count of named parameters in the SQL statement.
 void setTotalParameterCount(int totalParameterCount)
          Set the total count of all of the parameters in the SQL statement.
 void setUnnamedParameterCount(int unnamedParameterCount)
          Set the count of all of the unnamed parameters in the SQL statement.
 String toString()
          Exposes the original SQL String.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

ParsedSql

public ParsedSql(String originalSql)
Create a new instance of the ParsedSql class.

参数:
originalSql - the SQL statement that is being (or is to be) parsed
方法详细信息

getOriginalSql

public String getOriginalSql()
Return the SQL statement that is being parsed.


addNamedParameter

public void addNamedParameter(String parameterName,
                              int startIndex,
                              int endIndex)
Add a named parameter parsed from this SQL statement.

参数:
parameterName - the name of the parameter
startIndex - the start index in the original SQL String
endIndex - the end index in the original SQL String

getParameterNames

public List<String> getParameterNames()
Return all of the parameters (bind variables) in the parsed SQL statement. Repeated occurences of the same parameter name are included here.


getParameterIndexes

public int[] getParameterIndexes(int parameterPosition)
Return the parameter indexes for the specified parameter.

参数:
parameterPosition - the position of the parameter (as index in the parameter names List)
返回:
the start index and end index, combined into a int array of length 2

setNamedParameterCount

public void setNamedParameterCount(int namedParameterCount)
Set the count of named parameters in the SQL statement. Each parameter name counts once; repeated occurences do not count here.


getNamedParameterCount

public int getNamedParameterCount()
Return the count of named parameters in the SQL statement. Each parameter name counts once; repeated occurences do not count here.


setUnnamedParameterCount

public void setUnnamedParameterCount(int unnamedParameterCount)
Set the count of all of the unnamed parameters in the SQL statement.


getUnnamedParameterCount

public int getUnnamedParameterCount()
Return the count of all of the unnamed parameters in the SQL statement.


setTotalParameterCount

public void setTotalParameterCount(int totalParameterCount)
Set the total count of all of the parameters in the SQL statement. Repeated occurences of the same parameter name do count here.


getTotalParameterCount

public int getTotalParameterCount()
Return the total count of all of the parameters in the SQL statement. Repeated occurences of the same parameter name do count here.


toString

public String toString()
Exposes the original SQL String.

覆盖:
Object 中的 toString


Copyright © 2013-2014. All Rights Reserved.