Interface ColumnMapper<T>

    • Method Detail

      • getDefaultColumnMapper

        static <U> ColumnMapper<U> getDefaultColumnMapper()
      • map

        T map​(java.sql.ResultSet r,
              int columnNumber,
              StatementContext ctx)
        throws java.sql.SQLException
        Map the given column of the current row of the result set to an Object. This method should not cause the result set to advance; allow Jdbi to do that, please.
        Parameters:
        r - the result set being iterated
        columnNumber - the column number to map (starts at 1)
        ctx - the statement context
        Returns:
        the value to return for this column
        Throws:
        java.sql.SQLException - if anything goes wrong go ahead and let this percolate; Jdbi will handle it
      • map

        default T map​(java.sql.ResultSet r,
                      java.lang.String columnLabel,
                      StatementContext ctx)
               throws java.sql.SQLException
        Map the given column of the current row of the result set to an Object. This method should not cause the result set to advance; allow Jdbi to do that, please.
        Parameters:
        r - the result set being iterated
        columnLabel - the column label to map
        ctx - the statement context
        Returns:
        the value to return for this column
        Throws:
        java.sql.SQLException - if anything goes wrong go ahead and let this percolate; Jdbi will handle it
      • init

        default void init​(ConfigRegistry registry)
        Allows for initialization of the column mapper instance within a ConfigRegistry scope. This method is called once when the column mapper is first used from a ConfigRegistry.

        Note that handles, statements, sql objects etc. all create copies of the registry, and this method will be called for every copy

        Parameters:
        registry - A reference to the ConfigRegistry that this instance belongs to.