Class EmptySqlParameterSource
java.lang.Object
org.springframework.jdbc.core.namedparam.EmptySqlParameterSource
- All Implemented Interfaces:
SqlParameterSource
A simple empty implementation of the
SqlParameterSource interface.- Since:
- 3.2.2
- Author:
- Juergen Hoeller
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EmptySqlParameterSourceA shared instance ofEmptySqlParameterSource.Fields inherited from interface org.springframework.jdbc.core.namedparam.SqlParameterSource
TYPE_UNKNOWN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]Enumerate all available parameter names if possible.intgetSqlType(String paramName) Determine the SQL type for the specified named parameter.getTypeName(String paramName) Determine the type name for the specified named parameter.Return the parameter value for the requested named parameter.booleanDetermine whether there is a value for the specified named parameter.
-
Field Details
-
INSTANCE
A shared instance ofEmptySqlParameterSource.
-
-
Constructor Details
-
EmptySqlParameterSource
public EmptySqlParameterSource()
-
-
Method Details
-
hasValue
Description copied from interface:SqlParameterSourceDetermine whether there is a value for the specified named parameter.- Specified by:
hasValuein interfaceSqlParameterSource- Parameters:
paramName- the name of the parameter- Returns:
- whether there is a value defined
-
getValue
Description copied from interface:SqlParameterSourceReturn the parameter value for the requested named parameter.- Specified by:
getValuein interfaceSqlParameterSource- Parameters:
paramName- the name of the parameter- Returns:
- the value of the specified parameter
- Throws:
IllegalArgumentException- if there is no value for the requested parameter
-
getSqlType
Description copied from interface:SqlParameterSourceDetermine the SQL type for the specified named parameter.- Specified by:
getSqlTypein interfaceSqlParameterSource- Parameters:
paramName- the name of the parameter- Returns:
- the SQL type of the specified parameter,
or
TYPE_UNKNOWNif not known - See Also:
-
getTypeName
Description copied from interface:SqlParameterSourceDetermine the type name for the specified named parameter.- Specified by:
getTypeNamein interfaceSqlParameterSource- Parameters:
paramName- the name of the parameter- Returns:
- the type name of the specified parameter,
or
nullif not known
-
getParameterNames
Description copied from interface:SqlParameterSourceEnumerate all available parameter names if possible.This is an optional operation, primarily for use with
SimpleJdbcInsertandSimpleJdbcCall.- Specified by:
getParameterNamesin interfaceSqlParameterSource- Returns:
- the array of parameter names, or
nullif not determinable - See Also:
-