Class AbstractDelegatingSearchQuerySelectStep<SR,R,E,LOS>
java.lang.Object
org.hibernate.search.engine.search.query.dsl.spi.AbstractDelegatingSearchQuerySelectStep<SR,R,E,LOS>
- All Implemented Interfaces:
SearchQuerySelectStep<SR,
,SearchQueryOptionsStep<SR, ?, E, LOS, ?, ?>, R, E, LOS, TypedSearchProjectionFactory<SR, R, E>, TypedSearchPredicateFactory<SR>> SearchQueryWhereStep<SR,
SearchQueryOptionsStep<SR, ?, E, LOS, ?, ?>, E, LOS, TypedSearchPredicateFactory<SR>>
public abstract class AbstractDelegatingSearchQuerySelectStep<SR,R,E,LOS>
extends Object
implements SearchQuerySelectStep<SR,SearchQueryOptionsStep<SR,?,E,LOS,?,?>,R,E,LOS,TypedSearchProjectionFactory<SR,R,E>,TypedSearchPredicateFactory<SR>>
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractDelegatingSearchQuerySelectStep
(SearchQuerySelectStep<SR, ?, R, E, LOS, ?, ?> delegate) -
Method Summary
Modifier and TypeMethodDescription<T> T
Extend the current DSL step with the given extension, resulting in an extended step offering more query options.<P> SearchQueryWhereStep
<SR, ?, P, LOS, ?> Select an object projection as a representation of the search hit for each matching document.<P> SearchQueryWhereStep
<SR, ?, P, LOS, ?> select
(Function<? super TypedSearchProjectionFactory<SR, R, E>, ? extends ProjectionFinalStep<P>> projectionContributor) Select a given projection as a representation of the search hit for each matching document.SearchQueryWhereStep
<SR, ?, List<?>, LOS, ?> select
(SearchProjection<?>... projections) Select a list of projections as a representation of the search hit for each matching document.<P> SearchQueryWhereStep
<SR, ?, P, LOS, ?> select
(SearchProjection<P> projection) Select a projection as a representation of the search hit for each matching document.SearchQueryWhereStep
<SR, ?, E, LOS, ?> Select the entity was originally indexed as a representation of the search hit for each matching document.SearchQueryWhereStep
<SR, ?, R, LOS, ?> Select a reference to the entity that was originally indexed as a representation of the search hit for each matching document.SearchQueryOptionsStep
<SR, ?, E, LOS, ?, ?> where
(BiConsumer<? super TypedSearchPredicateFactory<SR>, ? super SimpleBooleanPredicateClausesCollector<SR, ?>> predicateContributor) Set the predicate for this query.SearchQueryOptionsStep
<SR, ?, E, LOS, ?, ?> where
(Function<? super TypedSearchPredicateFactory<SR>, ? extends PredicateFinalStep> predicateContributor) Set the predicate for this query.SearchQueryOptionsStep
<SR, ?, 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<SR,
SearchQueryOptionsStep<SR, ?, E, LOS, ?, ?>, R, E, LOS, TypedSearchProjectionFactory<SR, R, E>, TypedSearchPredicateFactory<SR>> - 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<SR,
SearchQueryOptionsStep<SR, ?, E, LOS, ?, ?>, R, E, LOS, TypedSearchProjectionFactory<SR, R, E>, TypedSearchPredicateFactory<SR>> - 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<SR,
SearchQueryOptionsStep<SR, ?, E, LOS, ?, ?>, R, E, LOS, TypedSearchProjectionFactory<SR, R, E>, TypedSearchPredicateFactory<SR>> - 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<SR,?, selectP, LOS, ?> (Function<? super TypedSearchProjectionFactory<SR, 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<SR,
SearchQueryOptionsStep<SR, ?, E, LOS, ?, ?>, R, E, LOS, TypedSearchProjectionFactory<SR, R, E>, TypedSearchPredicateFactory<SR>> - 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<SR,
SearchQueryOptionsStep<SR, ?, E, LOS, ?, ?>, R, E, LOS, TypedSearchProjectionFactory<SR, R, E>, TypedSearchPredicateFactory<SR>> - 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<SR,
SearchQueryOptionsStep<SR, ?, E, LOS, ?, ?>, R, E, LOS, TypedSearchProjectionFactory<SR, R, E>, TypedSearchPredicateFactory<SR>> - Parameters:
projections
- A list of previously-createdSearchProjection
objects.- Returns:
- The next step.
- See Also:
-
where
public SearchQueryOptionsStep<SR,?, whereE, LOS, ?, ?> (Function<? super TypedSearchPredicateFactory<SR>, ? extends PredicateFinalStep> predicateContributor) Description copied from interface:SearchQueryWhereStep
Set the predicate for this query.- Specified by:
where
in interfaceSearchQueryWhereStep<SR,
SearchQueryOptionsStep<SR, ?, E, LOS, ?, ?>, E, LOS, TypedSearchPredicateFactory<SR>> - 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<SR,?, whereE, LOS, ?, ?> (BiConsumer<? super TypedSearchPredicateFactory<SR>, ? super SimpleBooleanPredicateClausesCollector<SR, ?>> predicateContributor) Description copied from interface:SearchQueryWhereStep
Set the predicate for this query.- Specified by:
where
in interfaceSearchQueryWhereStep<SR,
SearchQueryOptionsStep<SR, ?, E, LOS, ?, ?>, E, LOS, TypedSearchPredicateFactory<SR>> - 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<SR,
SearchQueryOptionsStep<SR, ?, E, LOS, ?, ?>, E, LOS, TypedSearchPredicateFactory<SR>> - 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<SR,
SearchQueryOptionsStep<SR, ?, E, LOS, ?, ?>, R, E, LOS, TypedSearchProjectionFactory<SR, R, E>, TypedSearchPredicateFactory<SR>> - 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.
-