Class AbstractDelegatingSearchQuerySelectStep<R,E,LOS>
java.lang.Object
org.hibernate.search.engine.search.query.dsl.spi.AbstractDelegatingSearchQuerySelectStep<R,E,LOS>
- All Implemented Interfaces:
SearchQuerySelectStep<SearchQueryOptionsStep<?,
,E, LOS, ?, ?>, R, E, LOS, SearchProjectionFactory<R, E>, SearchPredicateFactory> SearchQueryWhereStep<SearchQueryOptionsStep<?,
E, LOS, ?, ?>, E, LOS, SearchPredicateFactory>
public abstract class AbstractDelegatingSearchQuerySelectStep<R,E,LOS>
extends Object
implements SearchQuerySelectStep<SearchQueryOptionsStep<?,E,LOS,?,?>,R,E,LOS,SearchProjectionFactory<R,E>,SearchPredicateFactory>
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractDelegatingSearchQuerySelectStep
(SearchQuerySelectStep<?, R, E, LOS, ?, ?> delegate) -
Method Summary
Modifier and TypeMethodDescription<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.<P> SearchQueryWhereStep
<?, P, LOS, ?> Select an object projection as a representation of the search hit for each matching document.<P> SearchQueryWhereStep
<?, P, LOS, ?> select
(Function<? super SearchProjectionFactory<R, E>, ? extends ProjectionFinalStep<P>> projectionContributor) Select a given projection as a representation of the search hit for each matching document.SearchQueryWhereStep
<?, List<?>, LOS, ?> select
(SearchProjection<?>... projections) Select a list of projections as a representation of the search hit for each matching document.<P> SearchQueryWhereStep
<?, P, LOS, ?> select
(SearchProjection<P> projection) Select a projection as a representation of the search hit for each matching document.SearchQueryWhereStep
<?, E, LOS, ?> Select the entity was originally indexed as a representation of the search hit for each matching document.SearchQueryWhereStep
<?, R, LOS, ?> Select a reference to the entity that was originally indexed as a representation of the search hit for each matching document.SearchQueryOptionsStep
<?, E, LOS, ?, ?> where
(BiConsumer<? super SearchPredicateFactory, ? super SimpleBooleanPredicateClausesCollector<?>> predicateContributor) Set the predicate for this query.SearchQueryOptionsStep
<?, E, LOS, ?, ?> where
(Function<? super SearchPredicateFactory, ? extends PredicateFinalStep> predicateContributor) Set the predicate for this query.SearchQueryOptionsStep
<?, E, LOS, ?, ?> where
(SearchPredicate predicate) Set the predicate for this query.
-
Constructor Details
-
AbstractDelegatingSearchQuerySelectStep
-
-
Method Details
-
selectEntity
Description copied from interface:SearchQuerySelectStep
Select the entity was originally indexed as a representation of the search hit for each matching document.The entity will be loaded directly from its original source (relational database, ...).
- Specified by:
selectEntity
in interfaceSearchQuerySelectStep<SearchQueryOptionsStep<?,
E, LOS, ?, ?>, R, E, LOS, SearchProjectionFactory<R, E>, SearchPredicateFactory> - Returns:
- The next step.
- See Also:
-
selectEntityReference
Description copied from interface:SearchQuerySelectStep
Select a reference to the entity that was originally indexed as a representation of the search hit for each matching document.Entity references are instances of type
EntityReference
, but some mappers may expose a different type for backwards compatibility reasons.EntityReference
should be favored wherever possible as mapper-specific types will eventually be removed.- Specified by:
selectEntityReference
in interfaceSearchQuerySelectStep<SearchQueryOptionsStep<?,
E, LOS, ?, ?>, R, E, LOS, SearchProjectionFactory<R, E>, SearchPredicateFactory> - Returns:
- The next step.
- See Also:
-
select
Description copied from interface:SearchQuerySelectStep
Select an object projection as a representation of the search hit for each matching document.- Specified by:
select
in interfaceSearchQuerySelectStep<SearchQueryOptionsStep<?,
E, LOS, ?, ?>, R, E, LOS, SearchProjectionFactory<R, E>, SearchPredicateFactory> - Type Parameters:
P
- The resulting type of the projection.- Parameters:
objectClass
- The type of objects returned by the projection. The class is expected to be mapped (generally through annotations) in such a way that it defines the inner projections.- Returns:
- The next step.
- See Also:
-
select
public <P> SearchQueryWhereStep<?,P, selectLOS, ?> (Function<? super SearchProjectionFactory<R, E>, ? extends ProjectionFinalStep<P>> projectionContributor) Description copied from interface:SearchQuerySelectStep
Select a given projection as a representation of the search hit for each matching document.- Specified by:
select
in interfaceSearchQuerySelectStep<SearchQueryOptionsStep<?,
E, LOS, ?, ?>, R, E, LOS, SearchProjectionFactory<R, E>, SearchPredicateFactory> - Type Parameters:
P
- The resulting type of the projection.- Parameters:
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.- Returns:
- The next step.
- See Also:
-
select
Description copied from interface:SearchQuerySelectStep
Select a projection as a representation of the search hit for each matching document.- Specified by:
select
in interfaceSearchQuerySelectStep<SearchQueryOptionsStep<?,
E, LOS, ?, ?>, R, E, LOS, SearchProjectionFactory<R, E>, SearchPredicateFactory> - Type Parameters:
P
- The resulting type of the projection.- Parameters:
projection
- A previously-createdSearchProjection
object.- Returns:
- The next step.
- See Also:
-
select
Description copied from interface:SearchQuerySelectStep
Select a list of projections as a representation of the search hit for each matching document.Note that using this method will force you to use casts when consuming the results, since the returned lists are not typed (
List<?>
instead ofList<T>
). You can replace calls to this method advantageously with calls toSearchQuerySelectStep.select(Function)
defining acomposite projection
.- Specified by:
select
in interfaceSearchQuerySelectStep<SearchQueryOptionsStep<?,
E, LOS, ?, ?>, R, E, LOS, SearchProjectionFactory<R, E>, SearchPredicateFactory> - Parameters:
projections
- A list of previously-createdSearchProjection
objects.- Returns:
- The next step.
- See Also:
-
where
public SearchQueryOptionsStep<?,E, whereLOS, ?, ?> (Function<? super SearchPredicateFactory, ? extends PredicateFinalStep> predicateContributor) Description copied from interface:SearchQueryWhereStep
Set the predicate for this query.- Specified by:
where
in interfaceSearchQueryWhereStep<SearchQueryOptionsStep<?,
E, LOS, ?, ?>, E, LOS, SearchPredicateFactory> - Parameters:
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.- Returns:
- The next step.
-
where
public SearchQueryOptionsStep<?,E, whereLOS, ?, ?> (BiConsumer<? super SearchPredicateFactory, ? super SimpleBooleanPredicateClausesCollector<?>> predicateContributor) Description copied from interface:SearchQueryWhereStep
Set the predicate for this query.- Specified by:
where
in interfaceSearchQueryWhereStep<SearchQueryOptionsStep<?,
E, LOS, ?, ?>, E, LOS, SearchPredicateFactory> - Parameters:
predicateContributor
- A consumer that will use the factory passed in parameter to create predicates and add them as clauses to the collector passed in parameter. Should generally be a lambda expression. The resulting root predicate will have to match all clauses.- Returns:
- The next step.
- See Also:
-
where
Description copied from interface:SearchQueryWhereStep
Set the predicate for this query.- Specified by:
where
in interfaceSearchQueryWhereStep<SearchQueryOptionsStep<?,
E, LOS, ?, ?>, E, LOS, SearchPredicateFactory> - Parameters:
predicate
- ASearchPredicate
object obtained from the search scope.- Returns:
- The next step.
-
extension
Description copied from interface:SearchQuerySelectStep
Extend the current DSL step with the given extension, resulting in an extended step offering more query options.- Specified by:
extension
in interfaceSearchQuerySelectStep<SearchQueryOptionsStep<?,
E, LOS, ?, ?>, R, E, LOS, SearchProjectionFactory<R, E>, SearchPredicateFactory> - Type Parameters:
T
- The type of DSL step provided by the extension.- Parameters:
extension
- The extension to the query DSL.- Returns:
- The extended DSL step.
-