Package com.landawn.abacus.jdbc
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:
-
Jdbc.Columns.ColumnOne
Columns.ColumnTwo
Columns.ColumnThree
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault <R> Jdbc.RowMapper<R>
andThen
(com.landawn.abacus.util.Throwables.Function<? super T, ? extends R, SQLException> after) builder()
builder
(Jdbc.ColumnGetter<?> defaultColumnGetter) static <A,
B, C> Jdbc.RowMapper<com.landawn.abacus.util.Tuple.Tuple3<A, B, C>> combine
(Jdbc.RowMapper<A> rowMapper1, Jdbc.RowMapper<B> rowMapper2, Jdbc.RowMapper<C> rowMapper3) static <T,
U> Jdbc.RowMapper<com.landawn.abacus.util.Tuple.Tuple2<T, U>> combine
(Jdbc.RowMapper<T> rowMapper1, Jdbc.RowMapper<U> rowMapper2) static <T> Jdbc.RowMapper<T>
from
(Jdbc.BiRowMapper<T> biRowMapper) Deprecated.because it's stateful and may be misused easily&frequentlydefault Jdbc.BiRowMapper<T>
static Jdbc.RowMapper<com.landawn.abacus.util.NoCachingNoUpdating.DisposableObjArray>
It's stateful.static Jdbc.RowMapper<com.landawn.abacus.util.NoCachingNoUpdating.DisposableObjArray>
toDisposableObjArray
(Class<?> entityClass) It's stateful.
-
Method Details
-
apply
- Specified by:
apply
in interfacecom.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
-
from
@Beta @Deprecated @SequentialOnly @Stateful static <T> Jdbc.RowMapper<T> from(Jdbc.BiRowMapper<T> biRowMapper) Deprecated.because it's stateful and may be misused easily&frequentlyIt'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<T> rowMapper1, Jdbc.RowMapper<U> rowMapper2) -
combine
static <A,B, Jdbc.RowMapper<com.landawn.abacus.util.Tuple.Tuple3<A,C> B, combineC>> (Jdbc.RowMapper<A> rowMapper1, Jdbc.RowMapper<B> rowMapper2, Jdbc.RowMapper<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 fromResultSet
by the type of fields/columns defined in this class.- Returns:
-
builder
-
builder
-