Interface CompositeProjectionValueStep<N extends CompositeProjectionOptionsStep<?,T>,T>
- Type Parameters:
N- The next step if a method other thancollector(ProjectionCollector.Provider)is called, i.e. the return type of methods defined inCompositeProjectionOptionsStepwhen called directly on this object.T- The type of composed projections.
- All Superinterfaces:
CompositeProjectionOptionsStep<N,,T> ProjectionFinalStep<T>
public interface CompositeProjectionValueStep<N extends CompositeProjectionOptionsStep<?,T>,T>
extends CompositeProjectionOptionsStep<N,T>
The step in a composite projection definition
where (optionally) the projection collector can be provided, e.g. to mark a projection as multi-valued (returning
List/Set etc.)
or wrapped in some other container (e.g. Optional<..>),
and where optional parameters can be set.
By default (if collector(ProjectionCollector.Provider) is not called), the projection is single-valued.
-
Method Summary
Modifier and TypeMethodDescriptiondefault CompositeProjectionOptionsStep<?, T[]> Defines the projection as multivalued, i.e. returningT[]instead ofT.<R> CompositeProjectionOptionsStep<?, R> collector(ProjectionCollector.Provider<T, R> collector) Defines how to accumulate composite projection values.default CompositeProjectionOptionsStep<?, List<T>> list()Defines the projection as multivalued, i.e. returningList<T>instead ofT.default CompositeProjectionOptionsStep<?, List<T>> multi()Deprecated.default CompositeProjectionOptionsStep<?, Optional<T>> optional()Defines the projection as single-valued wrapped in anOptional, i.e. returningOptional<T>instead ofT.default CompositeProjectionOptionsStep<?, Set<T>> set()Defines the projection as multivalued, i.e. returningSet<T>instead ofT.default CompositeProjectionOptionsStep<?, SortedSet<T>> Defines the projection as multivalued, i.e. returningSortedSet<T>instead ofT.default CompositeProjectionOptionsStep<?, SortedSet<T>> sortedSet(Comparator<T> comparator) Defines the projection as multivalued, i.e. returningSortedSet<T>instead ofT.Methods inherited from interface org.hibernate.search.engine.search.projection.dsl.ProjectionFinalStep
toProjection
-
Method Details
-
multi
Deprecated.Usecollector(ProjectionCollector.Provider)instead.Defines the projection as multi-valued, i.e. returningList<T>instead ofT.Calling
multi()is mandatory forobject projectionson multi-valued object fields, otherwise the projection will throw an exception upon creating the search query.Calling
multi()onbasic composite projectionsis generally not useful: the only effect is that projected values will be wrapped in a one-elementList.- Returns:
- A new step to define optional parameters for the projection.
-
collector
@Incubating <R> CompositeProjectionOptionsStep<?,R> collector(ProjectionCollector.Provider<T, R> collector) Defines how to accumulate composite projection values.Calling
.collector(someMultiValuedCollectorProvider)is mandatory for multi-valued fields, e.g..collector(ProjectionCollector.list()), otherwise the projection will throw an exception upon creating the query.- Type Parameters:
R- The type of the final result.- Parameters:
collector- The collector provider to apply to this projection.- Returns:
- A new step to define optional parameters for the accumulated projections.
-
optional
Defines the projection as single-valued wrapped in anOptional, i.e. returningOptional<T>instead ofT.- Returns:
- A new step to define optional parameters.
-
list
Defines the projection as multivalued, i.e. returningList<T>instead ofT.- Returns:
- A new step to define optional parameters.
-
set
Defines the projection as multivalued, i.e. returningSet<T>instead ofT.- Returns:
- A new step to define optional parameters.
-
sortedSet
Defines the projection as multivalued, i.e. returningSortedSet<T>instead ofT.- Returns:
- A new step to define optional parameters.
-
sortedSet
@Incubating default CompositeProjectionOptionsStep<?,SortedSet<T>> sortedSet(Comparator<T> comparator) Defines the projection as multivalued, i.e. returningSortedSet<T>instead ofT.- Parameters:
comparator- The comparator to use for sorting elements within the set.- Returns:
- A new step to define optional parameters.
-
array
Defines the projection as multivalued, i.e. returningT[]instead ofT.- Parameters:
type- The type of array elements.- Returns:
- A new step to define optional parameters.
-
collector(ProjectionCollector.Provider)instead.