com.holonplatform.reactor.datastore.operation

## Interface ReactiveQueryResults

- All Superinterfaces:
    com.holonplatform.core.query.QueryProjectionOperations<reactor.core.publisher.Flux,reactor.core.publisher.Mono,reactor.core.publisher.Mono,reactor.core.publisher.Mono<Long>>
  All Known Subinterfaces:
    ReactiveQuery

      public interface ReactiveQueryResults
      extends com.holonplatform.core.query.QueryProjectionOperations<reactor.core.publisher.Flux,reactor.core.publisher.Mono,reactor.core.publisher.Mono,reactor.core.publisher.Mono<Long>>

  Reactive `QueryProjectionOperations` API, which uses `Flux` and `Mono` to provide and handle the query results.
  Since:
    5.2.0
  See Also:
    `ReactiveQuery`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default reactor.core.publisher.Mono<Long>` | `count()` Convenience `countAll()` renamed method.
    `default reactor.core.publisher.Mono<Long>` | `countAll()` Count all the results of a query.
    `default <P extends com.holonplatform.core.property.Property> reactor.core.publisher.Mono<com.holonplatform.core.property.PropertyBox>` | `findOne(Iterable<P> properties)` Execute the query and get an expected unique result as a `PropertyBox` instance, using given `properties` as projection.
    `default reactor.core.publisher.Mono<com.holonplatform.core.property.PropertyBox>` | `findOne(com.holonplatform.core.property.Property... properties)` Execute the query and get an expected unique result as `PropertyBox` instance using the `Mono` representation, with given `properties` as query projection.
    `default <R> reactor.core.publisher.Mono<R>` | `findOne(com.holonplatform.core.query.QueryProjection<R> projection)` Execute the query and get an expected unique result using given `projection`.
    `default <P extends com.holonplatform.core.property.Property> reactor.core.publisher.Mono<List<com.holonplatform.core.property.PropertyBox>>` | `list(Iterable<P> properties)` Execute the query and get a `List` of query results as `PropertyBox` instances using a `Mono` representation, with given `properties` as query projection.
    `default reactor.core.publisher.Mono<List<com.holonplatform.core.property.PropertyBox>>` | `list(com.holonplatform.core.property.Property... properties)` Execute the query and get a `Mono` of the results `List` as `PropertyBox` instances, using given `properties` as projection.
    `default <R> reactor.core.publisher.Mono<List<R>>` | `list(com.holonplatform.core.query.QueryProjection<R> projection)` Convenience method to obtain the query results `stream(QueryProjection)` as a `List`, provided by a `Mono`.
    `default <P extends com.holonplatform.core.property.Property> reactor.core.publisher.Flux<com.holonplatform.core.property.PropertyBox>` | `stream(Iterable<P> properties)` Execute the query and get a `Flux` of query results as `PropertyBox` instances, using given `properties` as projection.
    `default reactor.core.publisher.Flux<com.holonplatform.core.property.PropertyBox>` | `stream(com.holonplatform.core.property.Property... properties)` Execute the query and get a `Flux` of query results as `PropertyBox` instances, using given `properties` as projection.
    `<R> reactor.core.publisher.Flux<R>` | `stream(com.holonplatform.core.query.QueryProjection<R> projection)` Execute the query and get a `Flux` of query results using given `projection`.

- - ### Method Detail

    - #### stream

          <R> reactor.core.publisher.Flux<R> stream(com.holonplatform.core.query.QueryProjection<R> projection)

      Execute the query and get a `Flux` of query results using given `projection`.
      Specified by:
        `stream` in interface `com.holonplatform.core.query.QueryProjectionOperations<reactor.core.publisher.Flux,reactor.core.publisher.Mono,reactor.core.publisher.Mono,reactor.core.publisher.Mono<Long>>`
      Type Parameters:
        `R` - Results type
      Parameters:
        `projection` - Query projection (not null)
      Returns:
        A `Flux` of query results
      Throws:
        `com.holonplatform.core.exceptions.DataAccessException` - If a query execution error occurred

    - #### list

          default <R> reactor.core.publisher.Mono<List<R>> list(com.holonplatform.core.query.QueryProjection<R> projection)

      Convenience method to obtain the query results `stream(QueryProjection)` as a `List`, provided by a `Mono`.
      Specified by:
        `list` in interface `com.holonplatform.core.query.QueryProjectionOperations<reactor.core.publisher.Flux,reactor.core.publisher.Mono,reactor.core.publisher.Mono,reactor.core.publisher.Mono<Long>>`
      Type Parameters:
        `R` - Results type
      Parameters:
        `projection` - Query projection (not null)
      Returns:
        A `Mono` of the query results list, empty if none
      Throws:
        `com.holonplatform.core.exceptions.DataAccessException` - If a query execution error occurred

    - #### findOne

          default <R> reactor.core.publisher.Mono<R> findOne(com.holonplatform.core.query.QueryProjection<R> projection)
                                                      throws com.holonplatform.core.query.QueryResults.QueryNonUniqueResultException

      Execute the query and get an expected unique result using given `projection`.

      If more than one result is returned by the query, a `QueryResults.QueryNonUniqueResultException` is thrown.

      Specified by:
        `findOne` in interface `com.holonplatform.core.query.QueryProjectionOperations<reactor.core.publisher.Flux,reactor.core.publisher.Mono,reactor.core.publisher.Mono,reactor.core.publisher.Mono<Long>>`
      Type Parameters:
        `R` - Result type
      Parameters:
        `projection` - Query projection (not null)
      Returns:
        A `Mono` of the unique query result (empty if no result was returned)
      Throws:
        `com.holonplatform.core.query.QueryResults.QueryNonUniqueResultException` - Only one result expected but more than one was found
        `com.holonplatform.core.exceptions.DataAccessException` - If a query execution error occurred

    - #### countAll

          default reactor.core.publisher.Mono<Long> countAll()

      Count all the results of a query.
      Specified by:
        `countAll` in interface `com.holonplatform.core.query.QueryProjectionOperations<reactor.core.publisher.Flux,reactor.core.publisher.Mono,reactor.core.publisher.Mono,reactor.core.publisher.Mono<Long>>`
      Returns:
        A `Mono` with the total results count, `0` if none
      Throws:
        `com.holonplatform.core.exceptions.DataAccessException` - If a query execution error occurred

    - #### count

          default reactor.core.publisher.Mono<Long> count()

      Convenience `countAll()` renamed method.
      Returns:
        A `Mono` with the total results count, `0` if none
      Throws:
        `com.holonplatform.core.exceptions.DataAccessException` - If a query execution error occurred

    - #### stream

          default <P extends com.holonplatform.core.property.Property> reactor.core.publisher.Flux<com.holonplatform.core.property.PropertyBox> stream(Iterable<P> properties)

      Execute the query and get a `Flux` of query results as `PropertyBox` instances, using given `properties` as projection.

      The returned `PropertyBox` instances will contain the values of the properties specified in given `properties` set.

      Specified by:
        `stream` in interface `com.holonplatform.core.query.QueryProjectionOperations<reactor.core.publisher.Flux,reactor.core.publisher.Mono,reactor.core.publisher.Mono,reactor.core.publisher.Mono<Long>>`
      Type Parameters:
        `P` - Property type
      Parameters:
        `properties` - Property set to use as projection (not null)
      Returns:
        A `Flux` of the query results
      Throws:
        `com.holonplatform.core.exceptions.DataAccessException` - If a query execution error occurred

    - #### findOne

          default <P extends com.holonplatform.core.property.Property> reactor.core.publisher.Mono<com.holonplatform.core.property.PropertyBox> findOne(Iterable<P> properties)
                                                                                                                                                 throws com.holonplatform.core.query.QueryResults.QueryNonUniqueResultException

      Execute the query and get an expected unique result as a `PropertyBox` instance, using given `properties` as projection.

      The returned `PropertyBox` instance will contain the values of the properties specified in given `properties` set.

      Specified by:
        `findOne` in interface `com.holonplatform.core.query.QueryProjectionOperations<reactor.core.publisher.Flux,reactor.core.publisher.Mono,reactor.core.publisher.Mono,reactor.core.publisher.Mono<Long>>`
      Type Parameters:
        `P` - Property type
      Parameters:
        `properties` - Property set to use as projection (not null)
      Returns:
        A `Mono` of the unique query result (empty if no results)
      Throws:
        `com.holonplatform.core.query.QueryResults.QueryNonUniqueResultException` - Only one result expected but more than one was found
        `com.holonplatform.core.exceptions.DataAccessException` - If a query execution error occurred

    - #### list

          default <P extends com.holonplatform.core.property.Property> reactor.core.publisher.Mono<List<com.holonplatform.core.property.PropertyBox>> list(Iterable<P> properties)

      Execute the query and get a `List` of query results as `PropertyBox` instances using a `Mono` representation, with given `properties` as query projection.

      The returned `PropertyBox` instances will contain the values of the properties specified in given `properties` set.

      Specified by:
        `list` in interface `com.holonplatform.core.query.QueryProjectionOperations<reactor.core.publisher.Flux,reactor.core.publisher.Mono,reactor.core.publisher.Mono,reactor.core.publisher.Mono<Long>>`
      Type Parameters:
        `P` - Property type
      Parameters:
        `properties` - Property set to use as projection (not null)
      Returns:
        A `Mono` of the query results `List`
      Throws:
        `com.holonplatform.core.exceptions.DataAccessException` - If a query execution error occurred

    - #### stream

          default reactor.core.publisher.Flux<com.holonplatform.core.property.PropertyBox> stream(com.holonplatform.core.property.Property... properties)

      Execute the query and get a `Flux` of query results as `PropertyBox` instances, using given `properties` as projection.

      The returned `PropertyBox` instances will contain the values of the properties specified in given `properties` set.

      Specified by:
        `stream` in interface `com.holonplatform.core.query.QueryProjectionOperations<reactor.core.publisher.Flux,reactor.core.publisher.Mono,reactor.core.publisher.Mono,reactor.core.publisher.Mono<Long>>`
      Parameters:
        `properties` - Property set to use as projection (not null)
      Returns:
        A `Flux` of the query results
      Throws:
        `com.holonplatform.core.exceptions.DataAccessException` - If a query execution error occurred

    - #### findOne

          default reactor.core.publisher.Mono<com.holonplatform.core.property.PropertyBox> findOne(com.holonplatform.core.property.Property... properties)
                                                                                            throws com.holonplatform.core.query.QueryResults.QueryNonUniqueResultException

      Execute the query and get an expected unique result as `PropertyBox` instance using the `Mono` representation, with given `properties` as query projection.

      The returned `PropertyBox` instance will contain the values of the properties specified in given `properties` set.

      Specified by:
        `findOne` in interface `com.holonplatform.core.query.QueryProjectionOperations<reactor.core.publisher.Flux,reactor.core.publisher.Mono,reactor.core.publisher.Mono,reactor.core.publisher.Mono<Long>>`
      Parameters:
        `properties` - Property set to use as projection (not null)
      Returns:
        A `Mono` of the unique query result ( empty if no results)
      Throws:
        `com.holonplatform.core.query.QueryResults.QueryNonUniqueResultException` - Only one result expected but more than one was found
        `com.holonplatform.core.exceptions.DataAccessException` - If a query execution error occurred

    - #### list

          default reactor.core.publisher.Mono<List<com.holonplatform.core.property.PropertyBox>> list(com.holonplatform.core.property.Property... properties)

      Execute the query and get a `Mono` of the results `List` as `PropertyBox` instances, using given `properties` as projection.

      The returned `PropertyBox` instances will contain the values of the properties specified in given `properties` set.

      Specified by:
        `list` in interface `com.holonplatform.core.query.QueryProjectionOperations<reactor.core.publisher.Flux,reactor.core.publisher.Mono,reactor.core.publisher.Mono,reactor.core.publisher.Mono<Long>>`
      Parameters:
        `properties` - Property set to use as projection (not null)
      Returns:
        A `Mono` of the query results `List`
      Throws:
        `com.holonplatform.core.exceptions.DataAccessException` - If a query execution error occurred

Copyright © 2019 The Holon Platform. All rights reserved.