类 AbstractSqlParameterSource
- java.lang.Object
- org.springframework.jdbc.core.namedparam.AbstractSqlParameterSource
- 所有已实现的接口:
SqlParameterSource
public abstract class AbstractSqlParameterSource extends Object implements SqlParameterSource
Abstract base class forSqlParameterSource
implementations. Provides registration of SQL types per parameter and a friendlytoString
representation enumerating all parameters for aSqlParameterSource
implementingSqlParameterSource.getParameterNames()
. Concrete subclasses must implementSqlParameterSource.hasValue(java.lang.String)
andSqlParameterSource.getValue(java.lang.String)
.- 从以下版本开始:
- 2.0
- 作者:
- Juergen Hoeller, Jens Schauder
- 另请参阅:
SqlParameterSource.hasValue(String)
,SqlParameterSource.getValue(String)
,SqlParameterSource.getParameterNames()
字段概要
从接口继承的字段 org.springframework.jdbc.core.namedparam.SqlParameterSource
TYPE_UNKNOWN
构造器概要
构造器 构造器 说明 AbstractSqlParameterSource()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 int
getSqlType(String paramName)
Return the SQL type for the given parameter, if registered.String
getTypeName(String paramName)
Return the type name for the given parameter, if registered.void
registerSqlType(String paramName, int sqlType)
Register an SQL type for the given parameter.void
registerTypeName(String paramName, String typeName)
Register an SQL type for the given parameter.String
toString()
Enumerate the parameter names and values with their corresponding SQL type if available, or just return the simpleSqlParameterSource
implementation class name otherwise.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
从接口继承的方法 org.springframework.jdbc.core.namedparam.SqlParameterSource
getParameterNames, getValue, hasValue
构造器详细资料
AbstractSqlParameterSource
public AbstractSqlParameterSource()
方法详细资料
registerSqlType
public void registerSqlType(String paramName, int sqlType)
Register an SQL type for the given parameter.- 参数:
paramName
- the name of the parametersqlType
- the SQL type of the parameter
registerTypeName
public void registerTypeName(String paramName, String typeName)
Register an SQL type for the given parameter.- 参数:
paramName
- the name of the parametertypeName
- the type name of the parameter
getSqlType
public int getSqlType(String paramName)
Return the SQL type for the given parameter, if registered.- 指定者:
getSqlType
在接口中SqlParameterSource
- 参数:
paramName
- the name of the parameter- 返回:
- the SQL type of the parameter, or
TYPE_UNKNOWN
if not registered - 另请参阅:
SqlParameterSource.TYPE_UNKNOWN
getTypeName
@Nullable public String getTypeName(String paramName)
Return the type name for the given parameter, if registered.- 指定者:
getTypeName
在接口中SqlParameterSource
- 参数:
paramName
- the name of the parameter- 返回:
- the type name of the parameter, or
null
if not registered
toString
public String toString()
Enumerate the parameter names and values with their corresponding SQL type if available, or just return the simpleSqlParameterSource
implementation class name otherwise.- 覆盖:
toString
在类中Object
- 从以下版本开始:
- 5.2
- 另请参阅:
SqlParameterSource.getParameterNames()