Interface DbRows<T>

  • Type Parameters:
    T - type of the result, starts as DbRow
    All Known Implementing Classes:
    MongoDbRows

    public interface DbRows<T>
    Execution result containing result set with multiple rows.
    • Method Detail

      • map

        <U> DbRows<U> map​(Function<T,​U> mapper)
        Map this row result using a mapping function.
        Type Parameters:
        U - new type of the row result
        Parameters:
        mapper - mapping function
        Returns:
        row result of the correct type
      • map

        <U> DbRows<U> map​(Class<U> type)
        Map this row result using a configured Mapper that can map current type to the desired type.

        The first mapping for row results of type DbRow will also try to locate appropriate mapper using DbMapperManager.

        Type Parameters:
        U - new type of the row result
        Parameters:
        type - class to map values to
        Returns:
        row result of the correct type
      • map

        <U> DbRows<U> map​(GenericType<U> type)
        Map this row result using a configured Mapper that can map current type to the desired type.

        The first mapping for row results of type DbRow will also try to locate appropriate mapper using DbMapperManager.

        Type Parameters:
        U - new type of the row result
        Parameters:
        type - generic type to map values to
        Returns:
        row result of the target type
      • publisher

        Flow.Publisher<T> publisher()
        Get this result as a publisher of rows mapped to the correct type.
        Returns:
        publisher
      • collect

        CompletionStage<List<T>> collect()
        Collect all the results into a list of rows mapped to the correct type.

        This is a dangerous operation, as it collects all results in memory. Use with care.

        Returns:
        future with the list