Interface ColumnHandler<T>

  • Type Parameters:
    T - The java type of values handled by this ColumnHandler.

    public interface ColumnHandler<T>
    Instances of this interface can be created by using DefaultRowMapperFactory class. But that resides in ijc.services.api module.
    Author:
    Tim Dudgeon
    • Method Detail

      • getColumnName

        java.lang.String getColumnName()
      • setColumnName

        void setColumnName​(java.lang.String columnName)
      • getJdbcType

        int getJdbcType()
      • setJdbcType

        void setJdbcType​(int jdbcType)
      • setLobHandler

        void setLobHandler​(org.springframework.jdbc.support.lob.LobHandler lobHandler)
      • getLobHandler

        org.springframework.jdbc.support.lob.LobHandler getLobHandler()
      • setSqlWriter

        void setSqlWriter​(SQLWriter sqlWriter)
      • readValue

        T readValue​(java.sql.ResultSet rs)
             throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • bindValue

        void bindValue​(java.sql.PreparedStatement stmt,
                       int index,
                       T value)
                throws java.sql.SQLException
        Binds a value to a PreparedStatement using index based (?) placeholder.
        Parameters:
        stmt - The PreparedStatement to set the value on.
        index - The placeholder index where the value will be set.
        value - The value to set, can be null.
        Throws:
        java.sql.SQLException - If the operation failed.
      • createPlaceHolder

        java.lang.String createPlaceHolder()
        Writes a placeholder to the SQL that will be used for a PreparedStaement. Usually this is just "?" but in some cases might need to include the use of functions.
        Returns:
        The placeholder SQL fragment that can be used in a SQL statement.
      • writeValue

        java.lang.String writeValue​(T value)
        Writes a value directly to SQL, quoting and escaping it as required. There is no guarantee that this method will work for all data types (e.g. blob and binary column types) and is best restricted to use for simple text and numeric types.
        Parameters:
        value - The value to write, can be null.
        Returns:
        The value literal suitable for including into a SQL select statements.
      • close

        void close()
        Cleans up any resources after use. Usually not needed, but can be needed in some cases such as the case of writing of Blobs
      • getType

        java.lang.Class<T> getType()
        Returns:
        the actual type T of this columnHandler. Should return the same as T.