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
Constructors Constructor Description AbstractDelegatingSearchQuerySelectStep(SearchQuerySelectStep<?,R,E,LOS,?,?> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <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(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,?>
selectEntity()
Select the entity was originally indexed as a representation of the search hit for each matching document.SearchQueryWhereStep<?,R,LOS,?>
selectEntityReference()
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(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 Detail
-
AbstractDelegatingSearchQuerySelectStep
public AbstractDelegatingSearchQuerySelectStep(SearchQuerySelectStep<?,R,E,LOS,?,?> delegate)
-
-
Method Detail
-
selectEntity
public SearchQueryWhereStep<?,E,LOS,?> 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:
SearchQueryWhereStep
-
selectEntityReference
public SearchQueryWhereStep<?,R,LOS,?> 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.- Specified by:
selectEntityReference
in interfaceSearchQuerySelectStep<SearchQueryOptionsStep<?,E,LOS,?,?>,R,E,LOS,SearchProjectionFactory<R,E>,SearchPredicateFactory>
- Returns:
- The next step.
- See Also:
SearchQueryWhereStep
-
select
public <P> SearchQueryWhereStep<?,P,LOS,?> select(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:
SearchQueryWhereStep
-
select
public <P> SearchQueryWhereStep<?,P,LOS,?> select(SearchProjection<P> projection)
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:
SearchQueryWhereStep
-
select
public SearchQueryWhereStep<?,List<?>,LOS,?> select(SearchProjection<?>... projections)
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:
SearchProjectionFactory.composite(SearchProjection[])
,SearchQueryWhereStep
-
where
public SearchQueryOptionsStep<?,E,LOS,?,?> where(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,LOS,?,?> where(SearchPredicate predicate)
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
public <T> T extension(SearchQueryDslExtension<T,R,E,LOS> 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.
-
-