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 Details

  • Method Details

    • apply

      T apply(ResultSet rs) 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.Function<ResultSet,T,SQLException>
      Parameters:
      rs -
      Returns:
      Throws:
      SQLException
    • andThen

      default <R> Jdbc.ResultExtractor<R> andThen(com.landawn.abacus.util.Throwables.Function<? super T,? extends R,SQLException> after)
      Type Parameters:
      R -
      Parameters:
      after -
      Returns:
    • toBiResultExtractor

      default Jdbc.BiResultExtractor<T> toBiResultExtractor()
      Returns:
    • 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 type
      V - the value type
      Parameters:
      keyExtractor -
      valueExtractor -
      Returns:
    • toMap

      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)
      Type Parameters:
      K - the key type
      V - the value type
      M -
      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 type
      V - the value type
      Parameters:
      keyExtractor -
      valueExtractor -
      mergeFunction -
      Returns:
    • toMap

      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)
      Type Parameters:
      K - the key type
      V - the value type
      M -
      Parameters:
      keyExtractor -
      valueExtractor -
      mergeFunction -
      supplier -
      Returns:
    • toMap

      @Deprecated static <K, V, D> Jdbc.ResultExtractor<Map<K,D>> toMap(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor, Collector<? super V,?,D> downstream)
      Deprecated.
      replaced by groupTo(RowMapper, RowMapper, Collector)
      Type Parameters:
      K - the key type
      V - the value type
      D -
      Parameters:
      keyExtractor -
      valueExtractor -
      downstream -
      Returns:
      See Also:
    • toMap

      @Deprecated static <K, V, D, M extends Map<K, D>> Jdbc.ResultExtractor<M> toMap(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor, Collector<? super V,?,D> downstream, Supplier<? extends M> supplier)
      Deprecated.
      replaced by groupTo(RowMapper, RowMapper, Collector, Supplier)
      Type Parameters:
      K - the key type
      V - the value type
      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 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.ResultExtractor<M> toMultimap(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor, 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.ResultExtractor<Map<K,List<V>>> groupTo(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends 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.ResultExtractor<M> groupTo(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor, Supplier<? extends M> supplier)
      Type Parameters:
      K - the key type
      V - the value type
      M -
      Parameters:
      keyExtractor -
      valueExtractor -
      supplier -
      Returns:
    • groupTo

      static <K, V, D> Jdbc.ResultExtractor<Map<K,D>> groupTo(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor, Collector<? super V,?,D> downstream)
      Type Parameters:
      K - the key type
      V - the value type
      D -
      Parameters:
      keyExtractor -
      valueExtractor -
      downstream -
      Returns:
    • groupTo

      static <K, V, D, M extends Map<K, D>> Jdbc.ResultExtractor<M> groupTo(Jdbc.RowMapper<? extends K> keyExtractor, Jdbc.RowMapper<? extends V> valueExtractor, Collector<? super V,?,D> downstream, Supplier<? extends M> supplier)
      Type Parameters:
      K - the key type
      V - the value type
      D -
      M -
      Parameters:
      keyExtractor -
      valueExtractor -
      downstream -
      supplier -
      Returns:
    • toList

      static <T> Jdbc.ResultExtractor<List<T>> toList(Jdbc.RowMapper<? extends T> rowMapper)
      Type Parameters:
      T -
      Parameters:
      rowMapper -
      Returns:
    • toList

      static <T> Jdbc.ResultExtractor<List<T>> toList(Jdbc.RowFilter rowFilter, Jdbc.RowMapper<? extends T> rowMapper)
      Type Parameters:
      T -
      Parameters:
      rowFilter -
      rowMapper -
      Returns:
    • toList

      static <T> Jdbc.ResultExtractor<List<T>> toList(Class<? extends T> targetClass)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      Returns:
    • toMergedList

      static <T> Jdbc.ResultExtractor<List<T>> toMergedList(Class<? extends T> targetClass)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      Returns:
      See Also:
      • DataSet.toMergedEntities(Class)
    • toMergedList

      static <T> Jdbc.ResultExtractor<List<T>> toMergedList(Class<? extends T> targetClass, String idPropNameForMerge)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      idPropNameForMerge -
      Returns:
      See Also:
      • DataSet.toMergedEntities(Class, Collection, Collection)
    • toMergedList

      static <T> Jdbc.ResultExtractor<List<T>> toMergedList(Class<? extends T> targetClass, Collection<String> idPropNamesForMerge)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      idPropNamesForMerge -
      Returns:
      See Also:
      • DataSet.toMergedEntities(Class, Collection, Collection)
    • toDataSet

      static Jdbc.ResultExtractor<com.landawn.abacus.util.DataSet> toDataSet(Class<?> entityClass)
      Parameters:
      entityClass -
      Returns:
    • toDataSet

      static Jdbc.ResultExtractor<com.landawn.abacus.util.DataSet> toDataSet(Class<?> entityClass, Map<String,String> prefixAndFieldNameMap)
      Parameters:
      entityClass -
      prefixAndFieldNameMap -
      Returns:
    • toDataSet

      static Jdbc.ResultExtractor<com.landawn.abacus.util.DataSet> toDataSet(Jdbc.RowFilter rowFilter)
      Parameters:
      rowFilter -
      Returns:
    • toDataSet

      static Jdbc.ResultExtractor<com.landawn.abacus.util.DataSet> toDataSet(Jdbc.RowExtractor rowExtractor)
      Parameters:
      rowExtractor -
      Returns:
    • toDataSet

      static Jdbc.ResultExtractor<com.landawn.abacus.util.DataSet> toDataSet(Jdbc.RowFilter rowFilter, Jdbc.RowExtractor rowExtractor)
      Parameters:
      rowFilter -
      rowExtractor -
      Returns:
    • to

      static <R> Jdbc.ResultExtractor<R> to(com.landawn.abacus.util.Throwables.Function<com.landawn.abacus.util.DataSet,R,SQLException> after)
      Type Parameters:
      R -
      Parameters:
      after -
      Returns: