Class EntityProjectionIntrospector
java.lang.Object
org.springframework.data.projection.EntityProjectionIntrospector
This class is introspects the returned type in the context of a domain type for all reachable properties (w/o cycles)
to determine which property paths are subject to projection.
- Since:
- 2.7
- Author:
- Gerrit Meier, Mark Paluch, Christoph Strobl, Oliver Drotbohm
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Represents a predicate (boolean-valued function) of atarget type
and itsunderlying type
. -
Method Summary
Modifier and TypeMethodDescriptionstatic EntityProjectionIntrospector
create
(ProjectionFactory projectionFactory, EntityProjectionIntrospector.ProjectionPredicate projectionPredicate, MappingContext<?, ?> mappingContext) Create a newEntityProjectionIntrospector
givenProjectionFactory
,EntityProjectionIntrospector.ProjectionPredicate
andMappingContext
.<M,
D> EntityProjection<M, D> introspect
(Class<M> mappedType, Class<D> domainType) Introspect amapped type
in the context of adomain type
whether the returned type is a projection and what property paths are participating in the projection.
-
Method Details
-
create
public static EntityProjectionIntrospector create(ProjectionFactory projectionFactory, EntityProjectionIntrospector.ProjectionPredicate projectionPredicate, MappingContext<?, ?> mappingContext) Create a newEntityProjectionIntrospector
givenProjectionFactory
,EntityProjectionIntrospector.ProjectionPredicate
andMappingContext
.- Parameters:
projectionFactory
- must not be null.projectionPredicate
- must not be null.mappingContext
- must not be null.- Returns:
- a new
EntityProjectionIntrospector
instance.
-
introspect
Introspect amapped type
in the context of adomain type
whether the returned type is a projection and what property paths are participating in the projection.Nested properties (direct types, within maps, collections) are introspected for nested projections and contain property paths for closed projections.
Deeply nested types (e.g.
Map<?, List<Person>>
) are represented with a property path that uses the unwrapped type and no longer the root domain typeD
.- Parameters:
mappedType
- must not be null.domainType
- must not be null.- Returns:
- the introspection result.
- See Also:
-