org.springframework.jdbc.core.namedparam

## Class EmptySqlParameterSource

- java.lang.Object
- - org.springframework.jdbc.core.namedparam.EmptySqlParameterSource

- All Implemented Interfaces:
    SqlParameterSource

      public class EmptySqlParameterSource
      extends Object
      implements SqlParameterSource

  A simple empty implementation of the `SqlParameterSource` interface.
  Since:
    3.2.2
  Author:
    Juergen Hoeller

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static EmptySqlParameterSource` | `INSTANCE` A shared instance of `EmptySqlParameterSource`.

    - ### Fields inherited from interface org.springframework.jdbc.core.namedparam.SqlParameterSource

      `TYPE_UNKNOWN`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EmptySqlParameterSource()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getSqlType(String paramName)` Determine the SQL type for the specified named parameter.
    `String` | `getTypeName(String paramName)` Determine the type name for the specified named parameter.
    `Object` | `getValue(String paramName)` Return the parameter value for the requested named parameter.
    `boolean` | `hasValue(String paramName)` Determine whether there is a value for the specified named parameter.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### INSTANCE

          public static final EmptySqlParameterSource INSTANCE

      A shared instance of `EmptySqlParameterSource`.

  - ### Constructor Detail

    - #### EmptySqlParameterSource

          public EmptySqlParameterSource()

  - ### Method Detail

    - #### hasValue

          public boolean hasValue(String paramName)

      Description copied from interface: `SqlParameterSource`
      Determine whether there is a value for the specified named parameter.
      Specified by:
        `hasValue` in interface `SqlParameterSource`
      Parameters:
        `paramName` - the name of the parameter
      Returns:
        whether there is a value defined

    - #### getValue

          public Object getValue(String paramName)
                          throws IllegalArgumentException

      Description copied from interface: `SqlParameterSource`
      Return the parameter value for the requested named parameter.
      Specified by:
        `getValue` in interface `SqlParameterSource`
      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

          public int getSqlType(String paramName)

      Description copied from interface: `SqlParameterSource`
      Determine the SQL type for the specified named parameter.
      Specified by:
        `getSqlType` in interface `SqlParameterSource`
      Parameters:
        `paramName` - the name of the parameter
      Returns:
        the SQL type of the specified parameter, or `TYPE_UNKNOWN` if not known
      See Also:
        `SqlParameterSource.TYPE_UNKNOWN`

    - #### getTypeName

          public String getTypeName(String paramName)

      Description copied from interface: `SqlParameterSource`
      Determine the type name for the specified named parameter.
      Specified by:
        `getTypeName` in interface `SqlParameterSource`
      Parameters:
        `paramName` - the name of the parameter
      Returns:
        the type name of the specified parameter, or `null` if not known