Class RowView

java.lang.Object
org.jdbi.v3.core.result.RowView

public abstract class RowView extends Object
A RowView is an accessor for ResultSet that uses RowMapper or ColumnMapper to extract values. It is not valid outside the scope of the method that receives it.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    getColumn(int column, Class<T> type)
    Use a column mapper to extract a type from the current ResultSet row.
    getColumn(int column, Type type)
    Use a column mapper to extract a type from the current ResultSet row.
    <T> T
    getColumn(int column, GenericType<T> type)
    Use a column mapper to extract a type from the current ResultSet row.
    abstract <T> T
    getColumn(int column, QualifiedType<T> type)
    Use a qualified column mapper to extract a type from the current ResultSet row.
    <T> T
    getColumn(String column, Class<T> type)
    Use a column mapper to extract a type from the current ResultSet row.
    getColumn(String column, Type type)
    Use a column mapper to extract a type from the current ResultSet row.
    <T> T
    getColumn(String column, GenericType<T> type)
    Use a column mapper to extract a type from the current ResultSet row.
    abstract <T> T
    getColumn(String column, QualifiedType<T> type)
    Use a qualified column mapper to extract a type from the current ResultSet row.
    <T> T
    getRow(Class<T> rowType)
    Use a row mapper to extract a type from the current ResultSet row.
    <T> T
    getRow(Class<T> rowType, String prefix)
    Use a prefixed row mapper to extract a type from the current ResultSet row.
    abstract Object
    getRow(Type type)
    Use a row mapper to extract a type from the current ResultSet row.
    getRow(Type type, String prefix)
    Use a prefixed row mapper to extract a type from the current ResultSet row.
    <T> T
    getRow(GenericType<T> rowType)
    Use a row mapper to extract a type from the current ResultSet row.
    <T> T
    getRow(GenericType<T> rowType, String prefix)
    Use a prefixed row mapper to extract a type from the current ResultSet row.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RowView

      public RowView()
  • Method Details

    • getRow

      public <T> T getRow(Class<T> rowType)
      Use a row mapper to extract a type from the current ResultSet row.
      Type Parameters:
      T - the type to map
      Parameters:
      rowType - the Class of the type
      Returns:
      the materialized T
    • getRow

      @Alpha public <T> T getRow(Class<T> rowType, String prefix)
      Use a prefixed row mapper to extract a type from the current ResultSet row. The mapper must declare the given column name prefix, see getRow(Type, String).
      Type Parameters:
      T - the type to map
      Parameters:
      rowType - the Class of the type
      prefix - the column name prefix the mapper must declare, never null
      Returns:
      the materialized T
    • getRow

      public <T> T getRow(GenericType<T> rowType)
      Use a row mapper to extract a type from the current ResultSet row.
      Type Parameters:
      T - the type to map
      Parameters:
      rowType - the GenericType of the type
      Returns:
      the materialized T
    • getRow

      @Alpha public <T> T getRow(GenericType<T> rowType, String prefix)
      Use a prefixed row mapper to extract a type from the current ResultSet row. The mapper must declare the given column name prefix, see getRow(Type, String).
      Type Parameters:
      T - the type to map
      Parameters:
      rowType - the GenericType of the type
      prefix - the column name prefix the mapper must declare, never null
      Returns:
      the materialized T
    • getRow

      public abstract Object getRow(Type type)
      Use a row mapper to extract a type from the current ResultSet row.
      Parameters:
      type - the type to map
      Returns:
      the materialized object
    • getRow

      @Alpha public Object getRow(Type type, String prefix)
      Use a prefixed row mapper to extract a type from the current ResultSet row.

      Only mappers that implement PrefixedRowMapper and declare a prefix equal to the given prefix take part in the lookup. This makes it possible to register multiple mappers for the same type with different column name prefixes, for example when a query joins the same table twice, and select between them per call. A mapper that does not declare the given prefix never matches; the lookup fails rather than fall back to an unprefixed mapper for the type. To look up a mapper by type alone, use getRow(Type).

      Parameters:
      type - the type to map
      prefix - the column name prefix the mapper must declare, never null
      Returns:
      the materialized object
      Throws:
      NoSuchMapperException - if no registered row mapper maps the given type with the given prefix
    • getColumn

      public <T> T getColumn(String column, Class<T> type)
      Use a column mapper to extract a type from the current ResultSet row.
      Type Parameters:
      T - the type to map
      Parameters:
      column - the column name
      type - the Class of the type
      Returns:
      the materialized T
    • getColumn

      public <T> T getColumn(int column, Class<T> type)
      Use a column mapper to extract a type from the current ResultSet row.
      Type Parameters:
      T - the type to map
      Parameters:
      column - the column index
      type - the Class of the type
      Returns:
      the materialized T
    • getColumn

      public <T> T getColumn(String column, GenericType<T> type)
      Use a column mapper to extract a type from the current ResultSet row.
      Type Parameters:
      T - the type to map
      Parameters:
      column - the column name
      type - the GenericType of the type
      Returns:
      the materialized T
    • getColumn

      public abstract <T> T getColumn(int column, QualifiedType<T> type)
      Use a qualified column mapper to extract a type from the current ResultSet row.
      Type Parameters:
      T - the type to map
      Parameters:
      column - the column index
      type - the QualifiedType of the type
      Returns:
      the materialized T
    • getColumn

      public abstract <T> T getColumn(String column, QualifiedType<T> type)
      Use a qualified column mapper to extract a type from the current ResultSet row.
      Type Parameters:
      T - the type to map
      Parameters:
      column - the column name
      type - the QualifiedType of the type
      Returns:
      the materialized T
    • getColumn

      public <T> T getColumn(int column, GenericType<T> type)
      Use a column mapper to extract a type from the current ResultSet row.
      Type Parameters:
      T - the type to map
      Parameters:
      column - the column index
      type - the GenericType of the type
      Returns:
      the materialized T
    • getColumn

      public Object getColumn(String column, Type type)
      Use a column mapper to extract a type from the current ResultSet row.
      Parameters:
      column - the column name
      type - the Type of the type
      Returns:
      the materialized object
    • getColumn

      public Object getColumn(int column, Type type)
      Use a column mapper to extract a type from the current ResultSet row.
      Parameters:
      column - the column name
      type - the Class of the type
      Returns:
      the materialized object