Interface SearchQuerySelectStep<N extends SearchQueryOptionsStep<?,E,LOS,?,?>,R,E,LOS,PJF extends SearchProjectionFactory<R,E>,PDF extends SearchPredicateFactory>
-
- Type Parameters:
N
- The next step if no type of hits is explicitly selected, i.e. ifSearchQueryWhereStep.where(SearchPredicate)
orSearchQueryWhereStep.where(Function)
is called directly without callingselectEntity()
, orselectEntityReference()
,select(SearchProjection)
or a similar method.R
- The type of entity references, i.e. the type of hits returned byreference queries
, or the type of objects returned forentity reference projections
.E
- The type of entities, i.e. the type of hits returned byentity queries
, or the type of objects returned forentity projections
.LOS
- The type of the initial step of the loading options definition DSL accessible throughSearchQueryOptionsStep.loading(Consumer)
.PJF
- The type of factory used to create projections inselect(Function)
.PDF
- The type of factory used to create predicates inSearchQueryWhereStep.where(Function)
.
- All Superinterfaces:
SearchQueryWhereStep<N,E,LOS,PDF>
- All Known Subinterfaces:
ElasticsearchSearchQuerySelectStep<R,E,LOS>
,LuceneSearchQuerySelectStep<R,E,LOS>
- All Known Implementing Classes:
AbstractDelegatingSearchQuerySelectStep
,AbstractSearchQuerySelectStep
public interface SearchQuerySelectStep<N extends SearchQueryOptionsStep<?,E,LOS,?,?>,R,E,LOS,PJF extends SearchProjectionFactory<R,E>,PDF extends SearchPredicateFactory> extends SearchQueryWhereStep<N,E,LOS,PDF>
The initial step in a query definition, where the element used to represent query hits, i.e. the "SELECT" clause, can be set.The "SELECT" clause may be omitted by setting the
"WHERE" clause
directly, in which caseselectEntity()
will be assumed.
-
-
Method Summary
All Methods Instance Methods Abstract 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 PJF,? 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.-
Methods inherited from interface org.hibernate.search.engine.search.query.dsl.SearchQueryWhereStep
where, where
-
-
-
-
Method Detail
-
selectEntity
SearchQueryWhereStep<?,E,LOS,?> selectEntity()
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, ...).
- Returns:
- The next step.
- See Also:
SearchQueryWhereStep
-
selectEntityReference
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.- Returns:
- The next step.
- See Also:
SearchQueryWhereStep
-
select
<P> SearchQueryWhereStep<?,P,LOS,?> select(Function<? super PJF,? extends ProjectionFinalStep<P>> projectionContributor)
Select a given projection as a representation of the search hit for each matching document.- 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
<P> SearchQueryWhereStep<?,P,LOS,?> select(SearchProjection<P> projection)
Select a projection as a representation of the search hit for each matching document.- Type Parameters:
P
- The resulting type of the projection.- Parameters:
projection
- A previously-createdSearchProjection
object.- Returns:
- The next step.
- See Also:
SearchQueryWhereStep
-
select
SearchQueryWhereStep<?,List<?>,LOS,?> select(SearchProjection<?>... projections)
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 toselect(Function)
defining acomposite projection
.- Parameters:
projections
- A list of previously-createdSearchProjection
objects.- Returns:
- The next step.
- See Also:
SearchProjectionFactory.composite(SearchProjection[])
,SearchQueryWhereStep
-
extension
<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.- 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.
- Throws:
SearchException
- If the extension cannot be applied (wrong underlying backend, ...).
-
-