Interface Jdbc.RowMapper<T>

Type Parameters:
T -
All Superinterfaces:
com.landawn.abacus.util.Throwables.Function<ResultSet,T,SQLException>
Enclosing class:
Jdbc
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface Jdbc.RowMapper<T> extends com.landawn.abacus.util.Throwables.Function<ResultSet,T,SQLException>
Don't use RowMapper in AbstractPreparedQuery.list(RowMapper) or any place where multiple records will be retrieved by it, if column labels/count are used in apply(ResultSet). Consider using BiRowMapper instead because it's more efficient to retrieve multiple records when column labels/count are used.
See Also:
  • Method Details

    • apply

      T apply(ResultSet rs) throws SQLException
      Specified by:
      apply in interface com.landawn.abacus.util.Throwables.Function<ResultSet,T,SQLException>
      Throws:
      SQLException
    • andThen

      default <R> Jdbc.RowMapper<R> andThen(com.landawn.abacus.util.Throwables.Function<? super T,? extends R,SQLException> after)
    • toBiRowMapper

      default Jdbc.BiRowMapper<T> toBiRowMapper()
    • from

      @Beta @Deprecated @SequentialOnly @Stateful static <T> Jdbc.RowMapper<T> from(Jdbc.BiRowMapper<? extends T> biRowMapper)
      Deprecated.
      because it's stateful and may be misused easily&frequently
      It's stateful. Don't save or cache the returned instance for reuse or use it in parallel stream.
      Type Parameters:
      T -
      Parameters:
      biRowMapper -
      Returns:
    • combine

      static <T, U> Jdbc.RowMapper<com.landawn.abacus.util.Tuple.Tuple2<T,U>> combine(Jdbc.RowMapper<? extends T> rowMapper1, Jdbc.RowMapper<? extends U> rowMapper2)
    • combine

      static <A, B, C> Jdbc.RowMapper<com.landawn.abacus.util.Tuple.Tuple3<A,B,C>> combine(Jdbc.RowMapper<? extends A> rowMapper1, Jdbc.RowMapper<? extends B> rowMapper2, Jdbc.RowMapper<? extends C> rowMapper3)
    • toDisposableObjArray

      @Beta @SequentialOnly @Stateful static Jdbc.RowMapper<com.landawn.abacus.util.NoCachingNoUpdating.DisposableObjArray> toDisposableObjArray()
      It's stateful. Don't save or cache the returned instance for reuse or use it in parallel stream.
      Returns:
    • toDisposableObjArray

      @Beta @SequentialOnly @Stateful static Jdbc.RowMapper<com.landawn.abacus.util.NoCachingNoUpdating.DisposableObjArray> toDisposableObjArray(Class<?> entityClass)
      It's stateful. Don't save or cache the returned instance for reuse or use it in parallel stream.
      Parameters:
      entityClass - used to fetch column/row value from ResultSet by the type of fields/columns defined in this class.
      Returns:
    • builder

    • builder

      static Jdbc.RowMapper.RowMapperBuilder builder(Jdbc.ColumnGetter<?> defaultColumnGetter)