public interface AsyncQueryResults extends QueryProjectionOperations<CompletionStage,CompletionStage,CompletionStage,CompletionStage<Long>>
QueryProjectionOperations
API, which uses CompletionStage
to provide the query results
and handle the results asynchronously.AsyncQuery
Modifier and Type | Method and Description |
---|---|
default CompletionStage<Long> |
count()
Convenience
countAll() renamed method. |
default CompletionStage<Long> |
countAll()
Count all the results of a query, asynchronously.
|
default <P extends Property> |
findOne(Iterable<P> properties)
Execute the query asynchronously and get an expected unique result as a
PropertyBox instance, using given
properties as projection. |
default CompletionStage<Optional<PropertyBox>> |
findOne(Property... properties)
Execute the query asynchronously and get an expected unique result as
PropertyBox instance, using given
properties as projection. |
default <R> CompletionStage<Optional<R>> |
findOne(QueryProjection<R> projection)
Execute query asynchronously and get an expected unique result using
projection to map result to
required type. |
default <P extends Property> |
list(Iterable<P> properties)
Execute the query asynchronously and get a
List of query results as PropertyBox instances, using
given properties as projection. |
default CompletionStage<List<PropertyBox>> |
list(Property... properties)
Execute the query asynchronously and get a
List of query results as PropertyBox instances, using
given properties as projection. |
default <R> CompletionStage<List<R>> |
list(QueryProjection<R> projection)
Convenience method to obtain the query results
stream(QueryProjection) as a List . |
default <P extends Property> |
stream(Iterable<P> properties)
Execute the query asynchronously and get a
Stream of query results as PropertyBox instances,
using given properties as projection. |
default CompletionStage<Stream<PropertyBox>> |
stream(Property... properties)
Execute the query asynchronously and get a
Stream of query results as PropertyBox instances,
using given properties as projection. |
<R> CompletionStage<Stream<R>> |
stream(QueryProjection<R> projection)
Execute query asynchronously and get a
Stream of query results using given projection to map
the results to the required type. |
<R> CompletionStage<Stream<R>> stream(QueryProjection<R> projection)
Stream
of query results using given projection
to map
the results to the required type.stream
in interface QueryProjectionOperations<CompletionStage,CompletionStage,CompletionStage,CompletionStage<Long>>
R
- Results typeprojection
- Query projection (not null)CompletionStage
of query results stream, an empty Stream if noneDataAccessException
- Error in query executiondefault <R> CompletionStage<List<R>> list(QueryProjection<R> projection)
stream(QueryProjection)
as a List
.list
in interface QueryProjectionOperations<CompletionStage,CompletionStage,CompletionStage,CompletionStage<Long>>
R
- Results typeprojection
- Query projection (not null)CompletionStage
of query results list, an empty List if noneDataAccessException
- Error in query executiondefault <R> CompletionStage<Optional<R>> findOne(QueryProjection<R> projection) throws QueryResults.QueryNonUniqueResultException
projection
to map result to
required type.
If more than one result is returned by the query, a QueryResults.QueryNonUniqueResultException
is thrown.
findOne
in interface QueryProjectionOperations<CompletionStage,CompletionStage,CompletionStage,CompletionStage<Long>>
R
- Result typeprojection
- Query projection (not null)CompletionStage
of the Optional unique query result (an empty Optional if no results was
returned)QueryResults.QueryNonUniqueResultException
- Only one result expected but more than one was foundDataAccessException
- Error in query executiondefault CompletionStage<Long> countAll()
countAll
in interface QueryProjectionOperations<CompletionStage,CompletionStage,CompletionStage,CompletionStage<Long>>
CompletionStage
of the total results countDataAccessException
- Error in query executiondefault CompletionStage<Long> count()
countAll()
renamed method.CompletionStage
of the total results countdefault <P extends Property> CompletionStage<Stream<PropertyBox>> stream(Iterable<P> properties)
Stream
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.
stream
in interface QueryProjectionOperations<CompletionStage,CompletionStage,CompletionStage,CompletionStage<Long>>
P
- Property typeproperties
- Property set to use as projection (not null)CompletionStage
of the query results Stream
(an empty Stream if none)DataAccessException
- Error in query executiondefault <P extends Property> CompletionStage<Optional<PropertyBox>> findOne(Iterable<P> properties) throws QueryResults.QueryNonUniqueResultException
PropertyBox
instance, using given
properties
as projection.
The returned PropertyBox
instance will contain the values of the properties specified in given
properties
set.
findOne
in interface QueryProjectionOperations<CompletionStage,CompletionStage,CompletionStage,CompletionStage<Long>>
P
- Property typeproperties
- Property set to use as projection (not null)CompletionStage
of the Optional unique query result (an empty Optional if no results was
returned)QueryResults.QueryNonUniqueResultException
- Only one result expected but more than one was foundDataAccessException
- Error in query executiondefault <P extends Property> CompletionStage<List<PropertyBox>> list(Iterable<P> properties)
List
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.
list
in interface QueryProjectionOperations<CompletionStage,CompletionStage,CompletionStage,CompletionStage<Long>>
P
- Property typeproperties
- Property set to use as projection (not null)CompletionStage
of the query results List
(an empty List if none)DataAccessException
- Error in query executiondefault CompletionStage<Stream<PropertyBox>> stream(Property... properties)
Stream
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.
stream
in interface QueryProjectionOperations<CompletionStage,CompletionStage,CompletionStage,CompletionStage<Long>>
properties
- Property set to use as projection (not null)CompletionStage
of the query results Stream
(an empty Stream if none)DataAccessException
- Error in query executiondefault CompletionStage<Optional<PropertyBox>> findOne(Property... properties) throws QueryResults.QueryNonUniqueResultException
PropertyBox
instance, using given
properties
as projection.
The returned PropertyBox
instance will contain the values of the properties specified in given
properties
set.
findOne
in interface QueryProjectionOperations<CompletionStage,CompletionStage,CompletionStage,CompletionStage<Long>>
properties
- Property set to use as projection (not null)CompletionStage
of the Optional unique query result (an empty Optional if no results was
returned)QueryResults.QueryNonUniqueResultException
- Only one result expected but more than one was foundDataAccessException
- Error in query executiondefault CompletionStage<List<PropertyBox>> list(Property... properties)
List
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.
list
in interface QueryProjectionOperations<CompletionStage,CompletionStage,CompletionStage,CompletionStage<Long>>
properties
- Property set to use as projection (not null)CompletionStage
of the query results List
(an empty List if none)DataAccessException
- Error in query executionCopyright © 2018 The Holon Platform. All rights reserved.