public abstract class AbstractSqlParameterSource extends java.lang.Object implements SqlParameterSource
SqlParameterSource
implementations.
Provides registration of SQL types per parameter.Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.lang.Integer> |
sqlTypes |
private java.util.Map<java.lang.String,java.lang.String> |
typeNames |
TYPE_UNKNOWN
Constructor and Description |
---|
AbstractSqlParameterSource() |
Modifier and Type | Method and Description |
---|---|
int |
getSqlType(java.lang.String paramName)
Return the SQL type for the given parameter, if registered.
|
java.lang.String |
getTypeName(java.lang.String paramName)
Return the type name for the given parameter, if registered.
|
void |
registerSqlType(java.lang.String paramName,
int sqlType)
Register a SQL type for the given parameter.
|
void |
registerTypeName(java.lang.String paramName,
java.lang.String typeName)
Register a SQL type for the given parameter.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getValue, hasValue
private final java.util.Map<java.lang.String,java.lang.Integer> sqlTypes
private final java.util.Map<java.lang.String,java.lang.String> typeNames
public void registerSqlType(java.lang.String paramName, int sqlType)
paramName
- the name of the parametersqlType
- the SQL type of the parameterpublic void registerTypeName(java.lang.String paramName, java.lang.String typeName)
paramName
- the name of the parametertypeName
- the type name of the parameterpublic int getSqlType(java.lang.String paramName)
getSqlType
in interface SqlParameterSource
paramName
- the name of the parameterTYPE_UNKNOWN
if not registeredSqlParameterSource.TYPE_UNKNOWN
public java.lang.String getTypeName(java.lang.String paramName)
getTypeName
in interface SqlParameterSource
paramName
- the name of the parameternull
if not registered