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
Modifier and TypeFieldDescriptionstatic final EmptySqlParameterSource
A shared instance ofEmptySqlParameterSource
.Fields inherited from interface org.springframework.jdbc.core.namedparam.SqlParameterSource
TYPE_UNKNOWN
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionString[]
Enumerate all available parameter names if possible.int
getSqlType
(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.boolean
Determine 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:SqlParameterSource
Determine whether there is a value for the specified named parameter.- Specified by:
hasValue
in interfaceSqlParameterSource
- Parameters:
paramName
- the name of the parameter- Returns:
- whether there is a value defined
-
getValue
Description copied from interface:SqlParameterSource
Return the parameter value for the requested named parameter.- Specified by:
getValue
in 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:SqlParameterSource
Determine the SQL type for the specified named parameter.- Specified by:
getSqlType
in interfaceSqlParameterSource
- Parameters:
paramName
- the name of the parameter- Returns:
- the SQL type of the specified parameter,
or
TYPE_UNKNOWN
if not known - See Also:
-
getTypeName
Description copied from interface:SqlParameterSource
Determine the type name for the specified named parameter.- Specified by:
getTypeName
in interfaceSqlParameterSource
- Parameters:
paramName
- the name of the parameter- Returns:
- the type name of the specified parameter,
or
null
if not known
-
getParameterNames
Description copied from interface:SqlParameterSource
Enumerate all available parameter names if possible.This is an optional operation, primarily for use with
SimpleJdbcInsert
andSimpleJdbcCall
.- Specified by:
getParameterNames
in interfaceSqlParameterSource
- Returns:
- the array of parameter names, or
null
if not determinable - See Also:
-