Class RoutingProjectionExecutor

java.lang.Object
nl.datasteel.crudcraft.projection.impl.RoutingProjectionExecutor
All Implemented Interfaces:
ProjectionExecutor

public class RoutingProjectionExecutor extends Object implements ProjectionExecutor
Delegates projection execution to the first ProjectionExecutorProvider that supports the given ProjectionQuery.
  • Constructor Details

    • RoutingProjectionExecutor

      public RoutingProjectionExecutor(List<ProjectionExecutorProvider> providers)
      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 appropriate ProjectionExecutorProvider based on the query type.
      Specified by:
      project in interface ProjectionExecutor
      Type Parameters:
      T - the type of the entity
      D - the type of the DTO
      Parameters:
      entityType - the type of the entity being projected
      dtoType - the type of the DTO to project into
      query - the projection query to execute
      Returns:
      a ProjectionResult containing the projected data