org.springframework.jdbc.core.namedparam

Class BeanPropertySqlParameterSource

    • Constructor Summary

      Constructors 
      Constructor and Description
      BeanPropertySqlParameterSource(java.lang.Object object)
      Create a new BeanPropertySqlParameterSource for the given bean.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String[] getParameterNames()
      Extract all available parameter names if possible.
      java.lang.String[] getReadablePropertyNames()
      Provide access to the property names of the wrapped bean.
      int getSqlType(java.lang.String paramName)
      Derives a default SQL type from the corresponding property type.
      java.lang.Object getValue(java.lang.String paramName)
      Return the parameter value for the requested named parameter.
      boolean hasValue(java.lang.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
    • Constructor Detail

      • BeanPropertySqlParameterSource

        public BeanPropertySqlParameterSource(java.lang.Object object)
        Create a new BeanPropertySqlParameterSource for the given bean.
        Parameters:
        object - the bean instance to wrap
    • Method Detail

      • hasValue

        public boolean hasValue(java.lang.String paramName)
        Description copied from interface: SqlParameterSource
        Determine whether there is a value for the specified named parameter.
        Parameters:
        paramName - the name of the parameter
        Returns:
        whether there is a value defined
      • getValue

        @Nullable
        public java.lang.Object getValue(java.lang.String paramName)
                                            throws java.lang.IllegalArgumentException
        Description copied from interface: SqlParameterSource
        Return the parameter value for the requested named parameter.
        Parameters:
        paramName - the name of the parameter
        Returns:
        the value of the specified parameter
        Throws:
        java.lang.IllegalArgumentException - if there is no value for the requested parameter
      • getReadablePropertyNames

        public java.lang.String[] getReadablePropertyNames()
        Provide access to the property names of the wrapped bean. Uses support provided in the PropertyAccessor interface.
        Returns:
        an array containing all the known property names