Package com.landawn.abacus.jdbc
Interface Jdbc.ResultExtractor<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.ResultExtractor<T>
extends com.landawn.abacus.util.Throwables.Function<ResultSet,T,SQLException>
The Interface ResultExtractor.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Jdbc.ResultExtractor<com.landawn.abacus.util.DataSet>
-
Method Summary
Modifier and TypeMethodDescriptiondefault <R> Jdbc.ResultExtractor<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 <K,
V> Jdbc.ResultExtractor<Map<K, List<V>>> groupTo
(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor) static <K,
V, M extends Map<K, List<V>>>
Jdbc.ResultExtractor<M>groupTo
(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor, Supplier<? extends M> supplier) static <K,
V, A, D> Jdbc.ResultExtractor<Map<K, D>> groupTo
(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor, Collector<? super V, A, D> downstream) static <K,
V, A, D, M extends Map<K, D>>
Jdbc.ResultExtractor<M>groupTo
(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor, Collector<? super V, A, D> downstream, Supplier<? extends M> supplier) static <R> Jdbc.ResultExtractor<R>
to
(com.landawn.abacus.util.Throwables.Function<com.landawn.abacus.util.DataSet, R, SQLException> after) default Jdbc.BiResultExtractor<T>
static Jdbc.ResultExtractor<com.landawn.abacus.util.DataSet>
toDataSet
(Jdbc.RowExtractor rowExtractor) static Jdbc.ResultExtractor<com.landawn.abacus.util.DataSet>
toDataSet
(Jdbc.RowFilter rowFilter) static Jdbc.ResultExtractor<com.landawn.abacus.util.DataSet>
toDataSet
(Jdbc.RowFilter rowFilter, Jdbc.RowExtractor rowExtractor) static Jdbc.ResultExtractor<com.landawn.abacus.util.DataSet>
It's stateful.static Jdbc.ResultExtractor<com.landawn.abacus.util.DataSet>
static <T> Jdbc.ResultExtractor<List<T>>
toList
(Jdbc.RowFilter rowFilter, Jdbc.RowMapper<? extends T> rowMapper) static <T> Jdbc.ResultExtractor<List<T>>
toList
(Jdbc.RowMapper<? extends T> rowMapper) static <T> Jdbc.ResultExtractor<List<T>>
It's stateful.static <K,
V> Jdbc.ResultExtractor<Map<K, V>> toMap
(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor) static <K,
V> Jdbc.ResultExtractor<Map<K, V>> toMap
(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor, BinaryOperator<V> mergeFunction) static <K,
V, M extends Map<K, V>>
Jdbc.ResultExtractor<M>toMap
(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor, BinaryOperator<V> mergeFunction, Supplier<? extends M> supplier) static <K,
V, M extends Map<K, V>>
Jdbc.ResultExtractor<M>toMap
(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor, Supplier<? extends M> supplier) static <K,
V, A, D> Jdbc.ResultExtractor<Map<K, D>> toMap
(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor, Collector<? super V, A, D> downstream) Deprecated.static <K,
V, A, D, M extends Map<K, D>>
Jdbc.ResultExtractor<M>toMap
(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor, Collector<? super V, A, D> downstream, Supplier<? extends M> supplier) Deprecated.replaced bygroupTo(RowMapper, RowMapper, Collector, Supplier)
static <T> Jdbc.ResultExtractor<List<T>>
toMergedList
(Class<? extends T> targetClass) It's stateful.static <T> Jdbc.ResultExtractor<List<T>>
toMergedList
(Class<? extends T> targetClass, Collection<String> idPropNamesForMerge) It's stateful.static <K,
V> Jdbc.ResultExtractor<com.landawn.abacus.util.ListMultimap<K, V>> toMultimap
(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor) static <K,
V, C extends Collection<V>, M extends com.landawn.abacus.util.Multimap<K, V, C>>
Jdbc.ResultExtractor<M>toMultimap
(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor, Supplier<? extends M> multimapSupplier) Methods inherited from interface com.landawn.abacus.util.Throwables.Function
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.Function<ResultSet,
T, SQLException> - Parameters:
rs
-- Throws:
SQLException
-
andThen
default <R> Jdbc.ResultExtractor<R> andThen(com.landawn.abacus.util.Throwables.Function<? super T, ? extends R, SQLException> after) -
toBiResultExtractor
-
toMap
static <K,V> Jdbc.ResultExtractor<Map<K,V>> toMap(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor) - Type Parameters:
K
- the key typeV
- the value type- Parameters:
keyExtractor
-valueExtractor
-- Returns:
-
toMap
static <K,V, Jdbc.ResultExtractor<M> toMapM extends Map<K, V>> (Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? 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.ResultExtractor<Map<K,V>> toMap(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? 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.ResultExtractor<M> toMapM extends Map<K, V>> (Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? 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.ResultExtractor<Map<K,A, D> D>> toMap(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor, Collector<? super V, A, D> downstream) Deprecated.replaced bygroupTo(RowMapper, RowMapper, Collector)
- Type Parameters:
K
- the key typeV
- the value typeA
-D
-- Parameters:
keyExtractor
-valueExtractor
-downstream
-- Returns:
- See Also:
-
toMap
@Deprecated static <K,V, Jdbc.ResultExtractor<M> toMapA, D, M extends Map<K, D>> (Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor, Collector<? super V, A, D> downstream, Supplier<? extends M> supplier) Deprecated.replaced bygroupTo(RowMapper, RowMapper, 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.ResultExtractor<com.landawn.abacus.util.ListMultimap<K,V>> toMultimap(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor) - Type Parameters:
K
- the key typeV
- the value type- Parameters:
keyExtractor
-valueExtractor
-- Returns:
-
toMultimap
static <K,V, Jdbc.ResultExtractor<M> toMultimapC extends Collection<V>, M extends com.landawn.abacus.util.Multimap<K, V, C>> (Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? 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.ResultExtractor<Map<K,List<V>>> groupTo(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor) - Type Parameters:
K
- the key typeV
- the value type- Parameters:
keyExtractor
-valueExtractor
-- Returns:
- Throws:
SQLException
-
groupTo
static <K,V, Jdbc.ResultExtractor<M> groupToM extends Map<K, List<V>>> (Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? 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.ResultExtractor<Map<K,A, D> D>> groupTo(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? 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.ResultExtractor<M> groupToA, D, M extends Map<K, D>> (Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? 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.ResultExtractor<List<T>> toList(Jdbc.RowFilter rowFilter, Jdbc.RowMapper<? extends T> rowMapper) -
toList
@SequentialOnly @Stateful static <T> Jdbc.ResultExtractor<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:
-
toMergedList
@SequentialOnly @Stateful static <T> Jdbc.ResultExtractor<List<T>> toMergedList(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:
- See Also:
-
DataSet.toMergedEntities(Class)
-
toMergedList
@SequentialOnly @Stateful static <T> Jdbc.ResultExtractor<List<T>> toMergedList(Class<? extends T> targetClass, Collection<String> idPropNamesForMerge) 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:
- See Also:
-
DataSet.toMergedEntities(Class, Collection, Collection)
-
toDataSet
@SequentialOnly @Stateful static Jdbc.ResultExtractor<com.landawn.abacus.util.DataSet> toDataSet(Class<?> entityClass) It's stateful. Don't save or cache the returned instance for reuse or use it in parallel stream.- Parameters:
entityClass
-- Returns:
-
toDataSet
@SequentialOnly @Stateful static Jdbc.ResultExtractor<com.landawn.abacus.util.DataSet> toDataSet(Class<?> entityClass, Map<String, String> prefixAndFieldNameMap) -
toDataSet
-
toDataSet
static Jdbc.ResultExtractor<com.landawn.abacus.util.DataSet> toDataSet(Jdbc.RowExtractor rowExtractor) -
toDataSet
static Jdbc.ResultExtractor<com.landawn.abacus.util.DataSet> toDataSet(Jdbc.RowFilter rowFilter, Jdbc.RowExtractor rowExtractor) -
to
static <R> Jdbc.ResultExtractor<R> to(com.landawn.abacus.util.Throwables.Function<com.landawn.abacus.util.DataSet, R, SQLException> after)
-
groupTo(RowMapper, RowMapper, Collector)