Interface DbResult

All Superinterfaces:
Iterable<DbResultValue<?>>

public interface DbResult extends Iterable<DbResultValue<?>>
A DbResult represents a single result (row) from a database (typically of a SelectStatement). It is an abstraction of a JDBC ResultSet.
Since:
1.0.0
See Also:
  • Method Details

    • getValue

      <V> V getValue(int i)
      Type Parameters:
      V - type of the value.
      Parameters:
      i - the index of the requested value. Has to be in the range from 0 to size-1.
      Returns:
      the requested result value.
    • getName

      String getName(int i)
      Parameters:
      i - the index of the requested name. Has to be in the range from 0 to size-1.
      Returns:
      the requested database name (e.g. column name, alias, selection).
    • getDeclaration

      default String getDeclaration(int i)
      Parameters:
      i - the index of the requested declaration. Has to be in the range from 0 to size-1.
      Returns:
      the requested declaration. Will be empty if not available.
    • indexOf

      default int indexOf(String name)
      Parameters:
      name - the potential name (column).
      Returns:
      the index i such that getName(i) will return the given name or -1 if no such index exists (name not found).
    • indexOfRequired

      default int indexOfRequired(String name)
      Parameters:
      name - the potential name (column).
      Returns:
      the index i such that getName(i) will return the given name.
      Throws:
      IllegalStateException - if no such index exists as the given name was not found.
    • getSize

      int getSize()
      Returns:
      the number of values.
    • iterator

      default Iterator<DbResultValue<?>> iterator()
      Specified by:
      iterator in interface Iterable<DbResultValue<?>>