Class LuceneSearchQuerySelectStepImpl<R,E,LOS>
- java.lang.Object
-
- org.hibernate.search.engine.search.query.dsl.spi.AbstractSearchQuerySelectStep<LuceneSearchQueryOptionsStep<E,LOS>,R,E,LOS,LuceneSearchProjectionFactory<R,E>,LuceneSearchPredicateFactory>
-
- org.hibernate.search.backend.lucene.search.query.dsl.impl.LuceneSearchQuerySelectStepImpl<R,E,LOS>
-
- All Implemented Interfaces:
LuceneSearchQuerySelectStep<R,E,LOS>,LuceneSearchQueryWhereStep<E,LOS>,SearchQuerySelectStep<LuceneSearchQueryOptionsStep<E,LOS>,R,E,LOS,LuceneSearchProjectionFactory<R,E>,LuceneSearchPredicateFactory>,SearchQueryWhereStep<LuceneSearchQueryOptionsStep<E,LOS>,E,LOS,LuceneSearchPredicateFactory>
public class LuceneSearchQuerySelectStepImpl<R,E,LOS> extends AbstractSearchQuerySelectStep<LuceneSearchQueryOptionsStep<E,LOS>,R,E,LOS,LuceneSearchProjectionFactory<R,E>,LuceneSearchPredicateFactory> implements LuceneSearchQuerySelectStep<R,E,LOS>
-
-
Constructor Summary
Constructors Constructor Description LuceneSearchQuerySelectStepImpl(LuceneSearchQueryIndexScope<?> scope, BackendSessionContext sessionContext, SearchLoadingContextBuilder<E,LOS> loadingContextBuilder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SearchLoadingContextBuilder<E,LOS>loadingContextBuilder()protected LuceneSearchQueryIndexScope<?>scope()<P> LuceneSearchQueryWhereStep<P,LOS>select(Class<P> objectClass)Select an object projection as a representation of the search hit for each matching document.<P> LuceneSearchQueryWhereStep<P,LOS>select(Function<? super LuceneSearchProjectionFactory<R,E>,? extends ProjectionFinalStep<P>> projectionContributor)Select a given projection as a representation of the search hit for each matching document.LuceneSearchQueryWhereStep<List<?>,LOS>select(SearchProjection<?>... projections)Select a list of projections as a representation of the search hit for each matching document.<P> LuceneSearchQueryWhereStep<P,LOS>select(SearchProjection<P> projection)Select a projection as a representation of the search hit for each matching document.LuceneSearchQueryWhereStep<E,LOS>selectEntity()Select the entity was originally indexed as a representation of the search hit for each matching document.LuceneSearchQueryWhereStep<R,LOS>selectEntityReference()Select a reference to the entity that was originally indexed as a representation of the search hit for each matching document.protected BackendSessionContextsessionContext()LuceneSearchQueryOptionsStep<E,LOS>where(BiConsumer<? super LuceneSearchPredicateFactory,? super SimpleBooleanPredicateClausesCollector<?>> predicateContributor)Set the predicate for this query.LuceneSearchQueryOptionsStep<E,LOS>where(Function<? super LuceneSearchPredicateFactory,? extends PredicateFinalStep> predicateContributor)Set the predicate for this query.LuceneSearchQueryOptionsStep<E,LOS>where(SearchPredicate predicate)Set the predicate for this query.-
Methods inherited from class org.hibernate.search.engine.search.query.dsl.spi.AbstractSearchQuerySelectStep
extension
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.search.engine.search.query.dsl.SearchQuerySelectStep
extension
-
-
-
-
Constructor Detail
-
LuceneSearchQuerySelectStepImpl
public LuceneSearchQuerySelectStepImpl(LuceneSearchQueryIndexScope<?> scope, BackendSessionContext sessionContext, SearchLoadingContextBuilder<E,LOS> loadingContextBuilder)
-
-
Method Detail
-
selectEntity
public LuceneSearchQueryWhereStep<E,LOS> selectEntity()
Description copied from interface:SearchQuerySelectStepSelect 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:
selectEntityin interfaceLuceneSearchQuerySelectStep<R,E,LOS>- Specified by:
selectEntityin interfaceSearchQuerySelectStep<LuceneSearchQueryOptionsStep<E,LOS>,R,E,LOS,LuceneSearchProjectionFactory<R,E>,LuceneSearchPredicateFactory>- Returns:
- The next step.
- See Also:
SearchQueryWhereStep
-
selectEntityReference
public LuceneSearchQueryWhereStep<R,LOS> selectEntityReference()
Description copied from interface:SearchQuerySelectStepSelect 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.EntityReferenceshould be favored wherever possible as mapper-specific types will eventually be removed.- Specified by:
selectEntityReferencein interfaceLuceneSearchQuerySelectStep<R,E,LOS>- Specified by:
selectEntityReferencein interfaceSearchQuerySelectStep<LuceneSearchQueryOptionsStep<E,LOS>,R,E,LOS,LuceneSearchProjectionFactory<R,E>,LuceneSearchPredicateFactory>- Returns:
- The next step.
- See Also:
SearchQueryWhereStep
-
select
public <P> LuceneSearchQueryWhereStep<P,LOS> select(Class<P> objectClass)
Description copied from interface:SearchQuerySelectStepSelect an object projection as a representation of the search hit for each matching document.- Specified by:
selectin interfaceLuceneSearchQuerySelectStep<R,E,LOS>- Specified by:
selectin interfaceSearchQuerySelectStep<LuceneSearchQueryOptionsStep<E,LOS>,R,E,LOS,LuceneSearchProjectionFactory<R,E>,LuceneSearchPredicateFactory>- 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:
SearchQueryWhereStep
-
select
public <P> LuceneSearchQueryWhereStep<P,LOS> select(Function<? super LuceneSearchProjectionFactory<R,E>,? extends ProjectionFinalStep<P>> projectionContributor)
Description copied from interface:SearchQuerySelectStepSelect a given projection as a representation of the search hit for each matching document.- Specified by:
selectin interfaceLuceneSearchQuerySelectStep<R,E,LOS>- Specified by:
selectin interfaceSearchQuerySelectStep<LuceneSearchQueryOptionsStep<E,LOS>,R,E,LOS,LuceneSearchProjectionFactory<R,E>,LuceneSearchPredicateFactory>- 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> LuceneSearchQueryWhereStep<P,LOS> select(SearchProjection<P> projection)
Description copied from interface:SearchQuerySelectStepSelect a projection as a representation of the search hit for each matching document.- Specified by:
selectin interfaceLuceneSearchQuerySelectStep<R,E,LOS>- Specified by:
selectin interfaceSearchQuerySelectStep<LuceneSearchQueryOptionsStep<E,LOS>,R,E,LOS,LuceneSearchProjectionFactory<R,E>,LuceneSearchPredicateFactory>- Type Parameters:
P- The resulting type of the projection.- Parameters:
projection- A previously-createdSearchProjectionobject.- Returns:
- The next step.
- See Also:
SearchQueryWhereStep
-
select
public LuceneSearchQueryWhereStep<List<?>,LOS> select(SearchProjection<?>... projections)
Description copied from interface:SearchQuerySelectStepSelect 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:
selectin interfaceLuceneSearchQuerySelectStep<R,E,LOS>- Specified by:
selectin interfaceSearchQuerySelectStep<LuceneSearchQueryOptionsStep<E,LOS>,R,E,LOS,LuceneSearchProjectionFactory<R,E>,LuceneSearchPredicateFactory>- Parameters:
projections- A list of previously-createdSearchProjectionobjects.- Returns:
- The next step.
- See Also:
SearchProjectionFactory.composite(SearchProjection[]),SearchQueryWhereStep
-
where
public LuceneSearchQueryOptionsStep<E,LOS> where(SearchPredicate predicate)
Description copied from interface:SearchQueryWhereStepSet the predicate for this query.- Specified by:
wherein interfaceSearchQueryWhereStep<LuceneSearchQueryOptionsStep<E,LOS>,E,LOS,LuceneSearchPredicateFactory>- Parameters:
predicate- ASearchPredicateobject obtained from the search scope.- Returns:
- The next step.
-
where
public LuceneSearchQueryOptionsStep<E,LOS> where(Function<? super LuceneSearchPredicateFactory,? extends PredicateFinalStep> predicateContributor)
Description copied from interface:SearchQueryWhereStepSet the predicate for this query.- Specified by:
wherein interfaceSearchQueryWhereStep<LuceneSearchQueryOptionsStep<E,LOS>,E,LOS,LuceneSearchPredicateFactory>- 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 LuceneSearchQueryOptionsStep<E,LOS> where(BiConsumer<? super LuceneSearchPredicateFactory,? super SimpleBooleanPredicateClausesCollector<?>> predicateContributor)
Description copied from interface:SearchQueryWhereStepSet the predicate for this query.- Specified by:
wherein interfaceSearchQueryWhereStep<LuceneSearchQueryOptionsStep<E,LOS>,E,LOS,LuceneSearchPredicateFactory>- 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:
SimpleBooleanPredicateClausesCollector
-
scope
protected LuceneSearchQueryIndexScope<?> scope()
- Specified by:
scopein classAbstractSearchQuerySelectStep<LuceneSearchQueryOptionsStep<E,LOS>,R,E,LOS,LuceneSearchProjectionFactory<R,E>,LuceneSearchPredicateFactory>
-
sessionContext
protected BackendSessionContext sessionContext()
- Specified by:
sessionContextin classAbstractSearchQuerySelectStep<LuceneSearchQueryOptionsStep<E,LOS>,R,E,LOS,LuceneSearchProjectionFactory<R,E>,LuceneSearchPredicateFactory>
-
loadingContextBuilder
protected SearchLoadingContextBuilder<E,LOS> loadingContextBuilder()
- Specified by:
loadingContextBuilderin classAbstractSearchQuerySelectStep<LuceneSearchQueryOptionsStep<E,LOS>,R,E,LOS,LuceneSearchProjectionFactory<R,E>,LuceneSearchPredicateFactory>
-
-