public abstract class AbstractDelegatingSearchQueryHitTypeStep<R,E,LOS> extends Object implements SearchQueryHitTypeStep<SearchQueryOptionsStep<?,E,LOS,?,?>,R,E,LOS,SearchProjectionFactory<R,E>,SearchPredicateFactory>
| Constructor and Description |
|---|
AbstractDelegatingSearchQueryHitTypeStep(SearchQueryHitTypeStep<?,R,E,LOS,?,?> delegate) |
| 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 SearchProjectionFactory<R,E>,? 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.
|
SearchQueryOptionsStep<?,E,LOS,?,?> |
predicate(Function<? super SearchPredicateFactory,? extends PredicateFinalStep> predicateContributor)
Set the predicate for this query.
|
SearchQueryOptionsStep<?,E,LOS,?,?> |
predicate(SearchPredicate predicate)
Set the predicate for this query.
|
public AbstractDelegatingSearchQueryHitTypeStep(SearchQueryHitTypeStep<?,R,E,LOS,?,?> delegate)
public SearchQueryPredicateStep<?,E,?> asEntity()
SearchQueryHitTypeStepasEntity in interface SearchQueryHitTypeStep<SearchQueryOptionsStep<?,E,LOS,?,?>,R,E,LOS,SearchProjectionFactory<R,E>,SearchPredicateFactory>SearchQueryPredicateSteppublic SearchQueryPredicateStep<?,R,?> asEntityReference()
SearchQueryHitTypeStepasEntityReference in interface SearchQueryHitTypeStep<SearchQueryOptionsStep<?,E,LOS,?,?>,R,E,LOS,SearchProjectionFactory<R,E>,SearchPredicateFactory>SearchQueryPredicateSteppublic <P> SearchQueryPredicateStep<?,P,?> asProjection(Function<? super SearchProjectionFactory<R,E>,? extends ProjectionFinalStep<P>> projectionContributor)
SearchQueryHitTypeStepasProjection in interface SearchQueryHitTypeStep<SearchQueryOptionsStep<?,E,LOS,?,?>,R,E,LOS,SearchProjectionFactory<R,E>,SearchPredicateFactory>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.SearchQueryPredicateSteppublic <P> SearchQueryPredicateStep<?,P,?> asProjection(SearchProjection<P> projection)
SearchQueryHitTypeStepasProjection in interface SearchQueryHitTypeStep<SearchQueryOptionsStep<?,E,LOS,?,?>,R,E,LOS,SearchProjectionFactory<R,E>,SearchPredicateFactory>P - The resulting type of the projection.projection - A previously-created SearchProjection object.SearchQueryPredicateSteppublic SearchQueryPredicateStep<?,List<?>,?> asProjections(SearchProjection<?>... projections)
SearchQueryHitTypeStep
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 SearchQueryHitTypeStep.asProjection(Function)
defining a composite projection.
asProjections in interface SearchQueryHitTypeStep<SearchQueryOptionsStep<?,E,LOS,?,?>,R,E,LOS,SearchProjectionFactory<R,E>,SearchPredicateFactory>projections - A list of previously-created SearchProjection objects.SearchProjectionFactory.composite(SearchProjection[]),
SearchQueryPredicateSteppublic SearchQueryOptionsStep<?,E,LOS,?,?> predicate(Function<? super SearchPredicateFactory,? extends PredicateFinalStep> predicateContributor)
SearchQueryPredicateSteppredicate in interface SearchQueryPredicateStep<SearchQueryOptionsStep<?,E,LOS,?,?>,E,SearchPredicateFactory>predicateContributor - A function that will use the factory passed in parameter to create a predicate,
returning the final step in the predicate DSL.
Should generally be a lambda expression.public SearchQueryOptionsStep<?,E,LOS,?,?> predicate(SearchPredicate predicate)
SearchQueryPredicateSteppredicate in interface SearchQueryPredicateStep<SearchQueryOptionsStep<?,E,LOS,?,?>,E,SearchPredicateFactory>predicate - A SearchPredicate object obtained from the search scope.public <T> T extension(SearchQueryDslExtension<T,R,E,LOS> extension)
SearchQueryHitTypeStepextension in interface SearchQueryHitTypeStep<SearchQueryOptionsStep<?,E,LOS,?,?>,R,E,LOS,SearchProjectionFactory<R,E>,SearchPredicateFactory>T - The type of DSL step provided by the extension.extension - The extension to the query DSL.Copyright © 2006-2020 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.