Class DbRowBase

java.lang.Object
io.helidon.dbclient.DbRowBase
All Implemented Interfaces:
DbRow

public abstract class DbRowBase extends Object implements DbRow
Base DbRow implementation.
  • Constructor Details

  • Method Details

    • column

      public DbColumn column(String name)
      Description copied from interface: DbRow
      Get a column in this row. Column is identified by its name.
      Specified by:
      column in interface DbRow
      Parameters:
      name - column name
      Returns:
      a column in this row
    • column

      public DbColumn column(int index)
      Description copied from interface: DbRow
      Get a column in this row. Column is identified by its index.
      Specified by:
      column in interface DbRow
      Parameters:
      index - column index starting from 1
      Returns:
      a column in this row
    • forEach

      public void forEach(Consumer<? super DbColumn> columnAction)
      Description copied from interface: DbRow
      Iterate through each column in this row.
      Specified by:
      forEach in interface DbRow
      Parameters:
      columnAction - what to do with each column
    • as

      public <T> T as(Class<T> type) throws MapperException
      Description copied from interface: DbRow
      Get specific class instance representation of this row. Mapper for target class must be already registered.
      Specified by:
      as in interface DbRow
      Type Parameters:
      T - type of the returned value
      Parameters:
      type - class of the returned value type
      Returns:
      instance of requested class containing this database row
      Throws:
      MapperException - in case the mapping is not defined or fails
    • as

      public <T> T as(GenericType<T> type) throws MapperException
      Description copied from interface: DbRow
      Map this row to an object using a DbMapper.
      Specified by:
      as in interface DbRow
      Type Parameters:
      T - type to be returned
      Parameters:
      type - type that supports generic declarations
      Returns:
      typed row
      Throws:
      MapperException - in case the mapping is not defined or fails
      MapperException - in case the mapping is not defined or fails
    • as

      public <T> T as(Function<DbRow,T> mapper)
      Description copied from interface: DbRow
      Get specific class instance representation of this row. Mapper for target class is provided as an argument.
      Specified by:
      as in interface DbRow
      Type Parameters:
      T - type of the returned value
      Parameters:
      mapper - method to create a target class instance from DbRow
      Returns:
      instance of requested class containing this database row