public interface QueryResults
Query execution.
Query results are obtained through a projection using QueryProjection, allowing results type specification.
Query| Modifier and Type | Interface and Description |
|---|---|
static class |
QueryResults.QueryExecutionException
Exception thrown for
Query execution errors. |
static class |
QueryResults.QueryNonUniqueResultException
Exception thrown by when only one query result was expected but more than one found.
|
static class |
QueryResults.QueryResultConversionException
Exception thrown for
Query results conversion or parsing errors. |
| Modifier and Type | Method and Description |
|---|---|
default long |
count()
Count all the results of a query.
|
default <P extends Property> |
findOne(Iterable<P> properties)
Execute query and get an expected unique result as
PropertyBox using given properties as
projection. |
default Optional<PropertyBox> |
findOne(Property... properties)
Execute query and get an expected unique result as
PropertyBox using given properties as
projection. |
default <R> Optional<R> |
findOne(QueryProjection<R> projection)
Execute query and get an expected unique result using
projection to map result to required type. |
default <P extends Property> |
list(Iterable<P> properties)
|
default List<PropertyBox> |
list(Property... properties)
|
default <R> List<R> |
list(QueryProjection<R> projection)
Convenience method to obtain query results
stream(QueryProjection) as a List |
default <P extends Property> |
stream(Iterable<P> properties)
Execute query and get a
Stream of query results as PropertyBox using given
properties as projection. |
default Stream<PropertyBox> |
stream(Property... properties)
Execute query and get a
Stream of query results as PropertyBox using given
properties as projection. |
<R> Stream<R> |
stream(QueryProjection<R> projection)
Execute query and get a
Stream of query results using given projection to map results to
required type. |
<R> Stream<R> stream(QueryProjection<R> projection) throws QueryResults.QueryExecutionException
Stream of query results using given projection to map results to
required type.R - Results typeprojection - Query projectionQueryResults.QueryExecutionException - Error in query executiondefault <R> List<R> list(QueryProjection<R> projection) throws QueryResults.QueryExecutionException
stream(QueryProjection) as a ListR - Results typeprojection - Query projectionQueryResults.QueryExecutionException - Error in query executiondefault <R> Optional<R> findOne(QueryProjection<R> projection) throws QueryResults.QueryExecutionException, QueryResults.QueryNonUniqueResultException
projection to map result to required type.
If more than one result is returned by the query, a QueryResults.QueryNonUniqueResultException is thrown.
R - Result typeprojection - Query projectionQueryResults.QueryExecutionException - Error in query executionQueryResults.QueryNonUniqueResultException - Only one result expected but more than one was founddefault long count()
throws QueryResults.QueryExecutionException
QueryResults.QueryExecutionException - Error in query executiondefault <P extends Property> Stream<PropertyBox> stream(Iterable<P> properties) throws QueryResults.QueryExecutionException
Stream of query results as PropertyBox using given
properties as projection.
Returned PropertyBox instances will contain the values of the properties specified in given
properties set.
P - Property typeproperties - Property set to fetchPropertyBox streamQueryResults.QueryExecutionException - Error in query executiondefault <P extends Property> Optional<PropertyBox> findOne(Iterable<P> properties) throws QueryResults.QueryExecutionException, QueryResults.QueryNonUniqueResultException
PropertyBox using given properties as
projection.
Returned PropertyBox instance will contain the values of the properties specified in given
properties set.
P - Property typeproperties - Property set to fetchQueryResults.QueryExecutionException - Error in query executionQueryResults.QueryNonUniqueResultException - Only one result expected but more than one was founddefault <P extends Property> List<PropertyBox> list(Iterable<P> properties) throws QueryResults.QueryExecutionException
List of query results as PropertyBox using given properties
as projection.
Returned PropertyBox instances will contain the values of the properties specified in given
properties set.
P - Property typeproperties - Property set to fetchPropertyBox listQueryResults.QueryExecutionException - Error in query executiondefault Stream<PropertyBox> stream(Property... properties) throws QueryResults.QueryExecutionException
Stream of query results as PropertyBox using given
properties as projection.
Returned PropertyBox instances will contain the values of the properties specified in given
properties set.
properties - Property set to fetchPropertyBox streamQueryResults.QueryExecutionException - Error in query executiondefault Optional<PropertyBox> findOne(Property... properties) throws QueryResults.QueryExecutionException, QueryResults.QueryNonUniqueResultException
PropertyBox using given properties as
projection.
Returned PropertyBox instance will contain the values of the properties specified in given
properties set.
properties - Property set to fetchQueryResults.QueryExecutionException - Error in query executionQueryResults.QueryNonUniqueResultException - Only one result expected but more than one was founddefault List<PropertyBox> list(Property... properties) throws QueryResults.QueryExecutionException
List of query results as PropertyBox using given properties
as projection.
Returned PropertyBox instances will contain the values of the properties specified in given
properties set.
properties - Property set to fetchPropertyBox listQueryResults.QueryExecutionException - Error in query executionCopyright © 2017 The Holon Platform. All rights reserved.