Class RoutingProjectionExecutor
java.lang.Object
nl.datasteel.crudcraft.projection.impl.RoutingProjectionExecutor
- All Implemented Interfaces:
ProjectionExecutor
Delegates projection execution to the first
ProjectionExecutorProvider
that supports the given ProjectionQuery.-
Constructor Summary
ConstructorsConstructorDescriptionRoutingProjectionExecutor(List<ProjectionExecutorProvider> providers) Constructs a new RoutingProjectionExecutor with the provided list of ProjectionExecutorProviders. -
Method Summary
Modifier and TypeMethodDescription<T,D> ProjectionResult <D> project(Class<T> entityType, Class<D> dtoType, ProjectionQuery<T> query) Executes the projection query by delegating to the appropriateProjectionExecutorProviderbased on the query type.
-
Constructor Details
-
RoutingProjectionExecutor
Constructs a new RoutingProjectionExecutor with the provided list of ProjectionExecutorProviders.- Parameters:
providers- a list of ProjectionExecutorProviders to route queries to
-
-
Method Details
-
project
public <T,D> ProjectionResult<D> project(Class<T> entityType, Class<D> dtoType, ProjectionQuery<T> query) Executes the projection query by delegating to the appropriateProjectionExecutorProviderbased on the query type.- Specified by:
projectin interfaceProjectionExecutor- Type Parameters:
T- the type of the entityD- the type of the DTO- Parameters:
entityType- the type of the entity being projecteddtoType- the type of the DTO to project intoquery- the projection query to execute- Returns:
- a
ProjectionResultcontaining the projected data
-