Package com.landawn.abacus.jdbc
Interface Jdbc.BiResultExtractor<T>
- Type Parameters:
T
-
- All Superinterfaces:
com.landawn.abacus.util.Throwables.BiFunction<ResultSet,
List<String>, 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.BiResultExtractor<T>
extends com.landawn.abacus.util.Throwables.BiFunction<ResultSet,List<String>,T,SQLException>
The Interface BiResultExtractor.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Jdbc.BiResultExtractor<com.landawn.abacus.util.DataSet>
-
Method Summary
Modifier and TypeMethodDescriptiondefault <R> Jdbc.BiResultExtractor<R>
andThen
(com.landawn.abacus.util.Throwables.Function<? super T, ? extends R, SQLException> after) In a lot of scenarios, including PreparedQuery/Dao/SQLExecutor, the inputResultSet
will be closed afterapply(rs)
call.static <R> Jdbc.BiResultExtractor<R>
from
(Jdbc.ResultExtractor<? extends R> resultExtractor) static <K,
V> Jdbc.BiResultExtractor<Map<K, List<V>>> groupTo
(Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor) static <K,
V, M extends Map<K, List<V>>>
Jdbc.BiResultExtractor<M>groupTo
(Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor, Supplier<? extends M> supplier) static <K,
V, A, D> Jdbc.BiResultExtractor<Map<K, D>> groupTo
(Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor, Collector<? super V, A, D> downstream) static <K,
V, A, D, M extends Map<K, D>>
Jdbc.BiResultExtractor<M>groupTo
(Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor, Collector<? super V, A, D> downstream, Supplier<? extends M> supplier) static <T> Jdbc.BiResultExtractor<List<T>>
toList
(Jdbc.BiRowFilter rowFilter, Jdbc.BiRowMapper<? extends T> rowMapper) static <T> Jdbc.BiResultExtractor<List<T>>
toList
(Jdbc.BiRowMapper<? extends T> rowMapper) static <T> Jdbc.BiResultExtractor<List<T>>
It's stateful.static <K,
V> Jdbc.BiResultExtractor<Map<K, V>> toMap
(Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor) static <K,
V> Jdbc.BiResultExtractor<Map<K, V>> toMap
(Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor, BinaryOperator<V> mergeFunction) static <K,
V, M extends Map<K, V>>
Jdbc.BiResultExtractor<M>toMap
(Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor, BinaryOperator<V> mergeFunction, Supplier<? extends M> supplier) static <K,
V, M extends Map<K, V>>
Jdbc.BiResultExtractor<M>toMap
(Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor, Supplier<? extends M> supplier) static <K,
V, A, D> Jdbc.BiResultExtractor<Map<K, D>> toMap
(Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor, Collector<? super V, A, D> downstream) Deprecated.static <K,
V, A, D, M extends Map<K, D>>
Jdbc.BiResultExtractor<M>toMap
(Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor, Collector<? super V, A, D> downstream, Supplier<? extends M> supplier) Deprecated.replaced bygroupTo(BiRowMapper, BiRowMapper, Collector, Supplier)
static <K,
V> Jdbc.BiResultExtractor<com.landawn.abacus.util.ListMultimap<K, V>> toMultimap
(Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor) static <K,
V, C extends Collection<V>, M extends com.landawn.abacus.util.Multimap<K, V, C>>
Jdbc.BiResultExtractor<M>toMultimap
(Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor, Supplier<? extends M> multimapSupplier) Methods inherited from interface com.landawn.abacus.util.Throwables.BiFunction
unchecked
-
Field Details
-
TO_DATA_SET
-
-
Method Details
-
apply
In a lot of scenarios, including PreparedQuery/Dao/SQLExecutor, the inputResultSet
will be closed afterapply(rs)
call. So don't save/return the inputResultSet
.- Specified by:
apply
in interfacecom.landawn.abacus.util.Throwables.BiFunction<ResultSet,
List<String>, T, SQLException> - Parameters:
rs
-columnLabels
-- Throws:
SQLException
-
andThen
default <R> Jdbc.BiResultExtractor<R> andThen(com.landawn.abacus.util.Throwables.Function<? super T, ? extends R, SQLException> after) -
from
-
toMap
static <K,V> Jdbc.BiResultExtractor<Map<K,V>> toMap(Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor) - Type Parameters:
K
- the key typeV
- the value type- Parameters:
keyExtractor
-valueExtractor
-- Returns:
-
toMap
static <K,V, Jdbc.BiResultExtractor<M> toMapM extends Map<K, V>> (Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor, Supplier<? extends M> supplier) - Type Parameters:
K
- the key typeV
- the value typeM
-- Parameters:
keyExtractor
-valueExtractor
-supplier
-- Returns:
-
toMap
static <K,V> Jdbc.BiResultExtractor<Map<K,V>> toMap(Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor, BinaryOperator<V> mergeFunction) - Type Parameters:
K
- the key typeV
- the value type- Parameters:
keyExtractor
-valueExtractor
-mergeFunction
-- Returns:
-
toMap
static <K,V, Jdbc.BiResultExtractor<M> toMapM extends Map<K, V>> (Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor, BinaryOperator<V> mergeFunction, Supplier<? extends M> supplier) - Type Parameters:
K
- the key typeV
- the value typeM
-- Parameters:
keyExtractor
-valueExtractor
-mergeFunction
-supplier
-- Returns:
-
toMap
@Deprecated static <K,V, Jdbc.BiResultExtractor<Map<K,A, D> D>> toMap(Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor, Collector<? super V, A, D> downstream) Deprecated.replaced bygroupTo(BiRowMapper, BiRowMapper, Collector)
- Type Parameters:
K
- the key typeV
- the value typeA
-D
-- Parameters:
keyExtractor
-valueExtractor
-downstream
-- Returns:
- See Also:
-
toMap
@Deprecated static <K,V, Jdbc.BiResultExtractor<M> toMapA, D, M extends Map<K, D>> (Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor, Collector<? super V, A, D> downstream, Supplier<? extends M> supplier) Deprecated.replaced bygroupTo(BiRowMapper, BiRowMapper, Collector, Supplier)
- Type Parameters:
K
- the key typeV
- the value typeA
-D
-M
-- Parameters:
keyExtractor
-valueExtractor
-downstream
-supplier
-- Returns:
- See Also:
-
toMultimap
static <K,V> Jdbc.BiResultExtractor<com.landawn.abacus.util.ListMultimap<K,V>> toMultimap(Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor) - Type Parameters:
K
- the key typeV
- the value type- Parameters:
keyExtractor
-valueExtractor
-- Returns:
-
toMultimap
static <K,V, Jdbc.BiResultExtractor<M> toMultimapC extends Collection<V>, M extends com.landawn.abacus.util.Multimap<K, V, C>> (Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor, Supplier<? extends M> multimapSupplier) - Type Parameters:
K
- the key typeV
- the value typeC
-M
-- Parameters:
keyExtractor
-valueExtractor
-multimapSupplier
-- Returns:
-
groupTo
static <K,V> Jdbc.BiResultExtractor<Map<K,List<V>>> groupTo(Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor) - Type Parameters:
K
- the key typeV
- the value type- Parameters:
keyExtractor
-valueExtractor
-- Returns:
-
groupTo
static <K,V, Jdbc.BiResultExtractor<M> groupToM extends Map<K, List<V>>> (Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor, Supplier<? extends M> supplier) - Type Parameters:
K
- the key typeV
- the value typeM
-- Parameters:
keyExtractor
-valueExtractor
-supplier
-- Returns:
-
groupTo
static <K,V, Jdbc.BiResultExtractor<Map<K,A, D> D>> groupTo(Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor, Collector<? super V, A, D> downstream) - Type Parameters:
K
- the key typeV
- the value typeA
-D
-- Parameters:
keyExtractor
-valueExtractor
-downstream
-- Returns:
-
groupTo
static <K,V, Jdbc.BiResultExtractor<M> groupToA, D, M extends Map<K, D>> (Jdbc.BiRowMapper<? extends K> keyExtractor, Jdbc.BiRowMapper<? extends V> valueExtractor, Collector<? super V, A, D> downstream, Supplier<? extends M> supplier) - Type Parameters:
K
- the key typeV
- the value typeA
-D
-M
-- Parameters:
keyExtractor
-valueExtractor
-downstream
-supplier
-- Returns:
-
toList
-
toList
static <T> Jdbc.BiResultExtractor<List<T>> toList(Jdbc.BiRowFilter rowFilter, Jdbc.BiRowMapper<? extends T> rowMapper) -
toList
@SequentialOnly @Stateful static <T> Jdbc.BiResultExtractor<List<T>> toList(Class<? extends T> targetClass) It's stateful. Don't save or cache the returned instance for reuse or use it in parallel stream.- Type Parameters:
T
-- Parameters:
targetClass
-- Returns:
-
groupTo(BiRowMapper, BiRowMapper, Collector)