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 Details

  • Method Details

    • apply

      T apply(ResultSet rs, List<String> columnLabels) throws SQLException
      In a lot of scenarios, including PreparedQuery/Dao/SQLExecutor, the input ResultSet will be closed after apply(rs) call. So don't save/return the input ResultSet.
      Specified by:
      apply in interface com.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

      static <R> Jdbc.BiResultExtractor<R> from(Jdbc.ResultExtractor<R> resultExtractor)
    • toMap

      static <K, V> Jdbc.BiResultExtractor<Map<K,V>> toMap(Jdbc.BiRowMapper<K> keyExtractor, Jdbc.BiRowMapper<V> valueExtractor)
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      keyExtractor -
      valueExtractor -
      Returns:
    • toMap

      static <K, V, M extends Map<K, V>> Jdbc.BiResultExtractor<M> toMap(Jdbc.BiRowMapper<K> keyExtractor, Jdbc.BiRowMapper<V> valueExtractor, com.landawn.abacus.util.function.Supplier<? extends M> supplier)
      Type Parameters:
      K - the key type
      V - the value type
      M -
      Parameters:
      keyExtractor -
      valueExtractor -
      supplier -
      Returns:
    • toMap

      static <K, V> Jdbc.BiResultExtractor<Map<K,V>> toMap(Jdbc.BiRowMapper<K> keyExtractor, Jdbc.BiRowMapper<V> valueExtractor, com.landawn.abacus.util.function.BinaryOperator<V> mergeFunction)
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      keyExtractor -
      valueExtractor -
      mergeFunction -
      Returns:
    • toMap

      static <K, V, M extends Map<K, V>> Jdbc.BiResultExtractor<M> toMap(Jdbc.BiRowMapper<K> keyExtractor, Jdbc.BiRowMapper<V> valueExtractor, com.landawn.abacus.util.function.BinaryOperator<V> mergeFunction, com.landawn.abacus.util.function.Supplier<? extends M> supplier)
      Type Parameters:
      K - the key type
      V - the value type
      M -
      Parameters:
      keyExtractor -
      valueExtractor -
      mergeFunction -
      supplier -
      Returns:
    • toMap

      @Deprecated static <K, V, A, D> Jdbc.BiResultExtractor<Map<K,D>> toMap(Jdbc.BiRowMapper<K> keyExtractor, Jdbc.BiRowMapper<V> valueExtractor, com.landawn.abacus.util.stream.Collector<? super V,A,D> downstream)
      Deprecated.
      replaced by groupTo(BiRowMapper, BiRowMapper, Collector)
      Type Parameters:
      K - the key type
      V - the value type
      A -
      D -
      Parameters:
      keyExtractor -
      valueExtractor -
      downstream -
      Returns:
      See Also:
    • toMap

      @Deprecated static <K, V, A, D, M extends Map<K, D>> Jdbc.BiResultExtractor<M> toMap(Jdbc.BiRowMapper<K> keyExtractor, Jdbc.BiRowMapper<V> valueExtractor, com.landawn.abacus.util.stream.Collector<? super V,A,D> downstream, com.landawn.abacus.util.function.Supplier<? extends M> supplier)
      Deprecated.
      replaced by groupTo(BiRowMapper, BiRowMapper, Collector, Supplier)
      Type Parameters:
      K - the key type
      V - the value type
      A -
      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<K> keyExtractor, Jdbc.BiRowMapper<V> valueExtractor)
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      keyExtractor -
      valueExtractor -
      Returns:
    • toMultimap

      static <K, V, C extends Collection<V>, M extends com.landawn.abacus.util.Multimap<K, V, C>> Jdbc.BiResultExtractor<M> toMultimap(Jdbc.BiRowMapper<K> keyExtractor, Jdbc.BiRowMapper<V> valueExtractor, com.landawn.abacus.util.function.Supplier<? extends M> multimapSupplier)
      Type Parameters:
      K - the key type
      V - the value type
      C -
      M -
      Parameters:
      keyExtractor -
      valueExtractor -
      multimapSupplier -
      Returns:
    • groupTo

      static <K, V> Jdbc.BiResultExtractor<Map<K,List<V>>> groupTo(Jdbc.BiRowMapper<K> keyExtractor, Jdbc.BiRowMapper<V> valueExtractor)
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      keyExtractor -
      valueExtractor -
      Returns:
    • groupTo

      static <K, V, M extends Map<K, List<V>>> Jdbc.BiResultExtractor<M> groupTo(Jdbc.BiRowMapper<K> keyExtractor, Jdbc.BiRowMapper<V> valueExtractor, com.landawn.abacus.util.function.Supplier<? extends M> supplier)
      Type Parameters:
      K - the key type
      V - the value type
      M -
      Parameters:
      keyExtractor -
      valueExtractor -
      supplier -
      Returns:
    • groupTo

      static <K, V, A, D> Jdbc.BiResultExtractor<Map<K,D>> groupTo(Jdbc.BiRowMapper<K> keyExtractor, Jdbc.BiRowMapper<V> valueExtractor, com.landawn.abacus.util.stream.Collector<? super V,A,D> downstream)
      Type Parameters:
      K - the key type
      V - the value type
      A -
      D -
      Parameters:
      keyExtractor -
      valueExtractor -
      downstream -
      Returns:
    • groupTo

      static <K, V, A, D, M extends Map<K, D>> Jdbc.BiResultExtractor<M> groupTo(Jdbc.BiRowMapper<K> keyExtractor, Jdbc.BiRowMapper<V> valueExtractor, com.landawn.abacus.util.stream.Collector<? super V,A,D> downstream, com.landawn.abacus.util.function.Supplier<? extends M> supplier)
      Type Parameters:
      K - the key type
      V - the value type
      A -
      D -
      M -
      Parameters:
      keyExtractor -
      valueExtractor -
      downstream -
      supplier -
      Returns:
    • toList

      static <T> Jdbc.BiResultExtractor<List<T>> toList(Jdbc.BiRowMapper<T> rowMapper)
    • toList

      static <T> Jdbc.BiResultExtractor<List<T>> toList(Jdbc.BiRowFilter rowFilter, Jdbc.BiRowMapper<T> rowMapper)
    • toList

      @SequentialOnly @Stateful static <T> Jdbc.BiResultExtractor<List<T>> toList(Class<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: