N - The next step if no type of hits is explicitly selected,
i.e. if SearchQueryPredicateStep.predicate(SearchPredicate) or SearchQueryPredicateStep.predicate(Function) is called directly
without calling asEntity(), or asEntityReference(), asProjection(SearchProjection)
or a similar method.R - The type of entity references, i.e. the type of hits returned by
reference queries,
or the type of objects returned for entity reference projections.E - The type of entities, i.e. the type of hits returned by
entity queries,
or the type of objects returned for entity projections.LOS - The type of the initial step of the loading options definition DSL accessible through SearchQueryOptionsStep.loading(Consumer).PJF - The type of factory used to create projections in asProjection(Function).PDF - The type of factory used to create predicates in SearchQueryPredicateStep.predicate(Function).public interface SearchQueryHitTypeStep<N extends SearchQueryOptionsStep<?,E,LOS,?,?>,R,E,LOS,PJF extends SearchProjectionFactory<R,E>,PDF extends SearchPredicateFactory> extends SearchQueryPredicateStep<N,E,PDF>
| Modifier and Type | Method and Description |
|---|---|
SearchQueryPredicateStep<?,E,?> |
asEntity()
Define the query results as the entity was originally indexed, loaded from an external source (database, ...).
|
SearchQueryPredicateStep<?,R,?> |
asEntityReference()
Define the query results as a reference to the entity that was originally indexed.
|
<P> SearchQueryPredicateStep<?,P,?> |
asProjection(Function<? super PJF,? extends ProjectionFinalStep<P>> projectionContributor)
Define the query results as one projection for each matching document.
|
<P> SearchQueryPredicateStep<?,P,?> |
asProjection(SearchProjection<P> projection)
Define the query results as one projection for each matching document.
|
SearchQueryPredicateStep<?,List<?>,?> |
asProjections(SearchProjection<?>... projections)
Define the query results as a list of projections for each matching document.
|
<T> T |
extension(SearchQueryDslExtension<T,R,E,LOS> extension)
Extend the current DSL step with the given extension,
resulting in an extended step offering more query options.
|
predicate, predicateSearchQueryPredicateStep<?,E,?> asEntity()
SearchQueryPredicateStepSearchQueryPredicateStep<?,R,?> asEntityReference()
SearchQueryPredicateStep<P> SearchQueryPredicateStep<?,P,?> asProjection(Function<? super PJF,? extends ProjectionFinalStep<P>> projectionContributor)
P - The resulting type of the projection.projectionContributor - A function that will use the factory passed in parameter to create a projection,
returning the final step in the projection DSL.
Should generally be a lambda expression.SearchQueryPredicateStep<P> SearchQueryPredicateStep<?,P,?> asProjection(SearchProjection<P> projection)
P - The resulting type of the projection.projection - A previously-created SearchProjection object.SearchQueryPredicateStepSearchQueryPredicateStep<?,List<?>,?> asProjections(SearchProjection<?>... projections)
Note that using this method will force you to use casts when consuming the results,
since the returned lists are not typed (List<?> instead of List<T>).
You can replace calls to this method advantageously with calls to asProjection(Function)
defining a composite projection.
projections - A list of previously-created SearchProjection objects.SearchProjectionFactory.composite(SearchProjection[]),
SearchQueryPredicateStep<T> T extension(SearchQueryDslExtension<T,R,E,LOS> extension)
T - The type of DSL step provided by the extension.extension - The extension to the query DSL.SearchException - If the extension cannot be applied (wrong underlying backend, ...).Copyright © 2006-2020 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.