-
- Type Parameters:
T- type of the result, starts asDbRow
- All Known Implementing Classes:
MongoDbRows
public interface DbRows<T>Execution result containing result set with multiple rows.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompletionStage<List<T>>collect()Collect all the results into a list of rows mapped to the correct type.<U> DbRows<U>map(GenericType<U> type)Map this row result using a configuredMapperthat can map current type to the desired type.<U> DbRows<U>map(Class<U> type)Map this row result using a configuredMapperthat can map current type to the desired type.<U> DbRows<U>map(Function<T,U> mapper)Map this row result using a mapping function.Flow.Publisher<T>publisher()Get this result as a publisher of rows mapped to the correct type.
-
-
-
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 configuredMapperthat can map current type to the desired type.The first mapping for row results of type
DbRowwill also try to locate appropriate mapper usingDbMapperManager.- 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 configuredMapperthat can map current type to the desired type.The first mapping for row results of type
DbRowwill also try to locate appropriate mapper usingDbMapperManager.- 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
-
-