Interface ProjectionDefinition<P>
- Type Parameters:
P
- The type of the element returned by the projection.
- All Known Subinterfaces:
CompositeProjectionDefinition<T>
- All Known Implementing Classes:
AbstractProjectionDefinition
,ConstantProjectionDefinition
,DistanceProjectionDefinition
,DistanceProjectionDefinition.MultiValued
,DistanceProjectionDefinition.SingleValued
,DistanceProjectionDefinition.WrappedValued
,FieldProjectionDefinition
,FieldProjectionDefinition.AccumulatedValued
,FieldProjectionDefinition.MultiValued
,FieldProjectionDefinition.SingleValued
,ObjectProjectionDefinition
,ObjectProjectionDefinition.MultiValued
,ObjectProjectionDefinition.SingleValued
,ObjectProjectionDefinition.WrappedValued
A component able to define a projection using the Hibernate Search Projection DSL.
Used in particular for projections defined using mapper features, e.g. Java annotations
(see org.hibernate.search.mapper.pojo.mapping.definition.annotation.IdProjection
,
org.hibernate.search.mapper.pojo.mapping.definition.annotation.FieldProjection
, etc.).
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionSearchProjection
<? extends P> create
(SearchProjectionFactory<?, ?> factory, ProjectionDefinitionContext context) Creates a projection with a specific projected type.
-
Method Details
-
create
SearchProjection<? extends P> create(SearchProjectionFactory<?, ?> factory, ProjectionDefinitionContext context) Creates a projection with a specific projected type.- Parameters:
factory
- A projection factory. If the projection is used in the context of an object field, this factory expects field paths to be provided relative to that same object field. This factory is only valid in the present context and must not be used aftercreate(SearchProjectionFactory, ProjectionDefinitionContext)
returns.context
- The context in which the definition is applied.- Returns:
- The created
SearchPredicate
. - Throws:
RuntimeException
- If the creation of the projection fails.- See Also:
-