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
Nested ClassesModifier and TypeClassDescriptionstatic interfaceRepresents a predicate (boolean-valued function) of atarget typeand itsunderlying type. -
Method Summary
Modifier and TypeMethodDescriptionstatic EntityProjectionIntrospectorcreate(ProjectionFactory projectionFactory, EntityProjectionIntrospector.ProjectionPredicate projectionPredicate, MappingContext<?, ?> mappingContext) Create a newEntityProjectionIntrospectorgivenProjectionFactory,EntityProjectionIntrospector.ProjectionPredicateandMappingContext.<M,D> EntityProjection<M, D> introspect(Class<M> mappedType, Class<D> domainType) Introspect amapped typein the context of adomain typewhether 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 newEntityProjectionIntrospectorgivenProjectionFactory,EntityProjectionIntrospector.ProjectionPredicateandMappingContext.- Parameters:
projectionFactory- must not be null.projectionPredicate- must not be null.mappingContext- must not be null.- Returns:
- a new
EntityProjectionIntrospectorinstance.
-
introspect
Introspect amapped typein the context of adomain typewhether 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:
-