Class SingleColumnMapper<T>

    • Field Detail

    • Constructor Detail

      • SingleColumnMapper

        public SingleColumnMapper​(ColumnMapper<T> mapper)
        Constructs a row mapper which maps the first column.
        Parameters:
        mapper - the column mapper to delegate to for mapping.
      • SingleColumnMapper

        public SingleColumnMapper​(ColumnMapper<T> mapper,
                                  int columnNumber)
        Constructs a row mapper which maps the given column number.
        Parameters:
        mapper - the column mapper to delegate to for mapping
        columnNumber - the column number (1-based) to map
      • SingleColumnMapper

        public SingleColumnMapper​(ColumnMapper<T> mapper,
                                  java.lang.String columnLabel)
        Constructs a row mapper which maps the column with the given label.
        Parameters:
        mapper - the column mapper to delegate to for mapping
        columnLabel - the label of the column to map
    • Method Detail

      • map

        public T map​(java.sql.ResultSet r,
                     StatementContext ctx)
              throws java.sql.SQLException
        Description copied from interface: RowMapper
        Map the current row of the result set. This method should not cause the result set to advance; allow Jdbi to do that, please.
        Specified by:
        map in interface RowMapper<T>
        Parameters:
        r - the result set being iterated
        ctx - the statement context
        Returns:
        the value to produce for this row
        Throws:
        java.sql.SQLException - if anything goes wrong go ahead and let this percolate; Jdbi will handle it