Class QuerydslProjectionExecutor

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

public class QuerydslProjectionExecutor extends Object implements ProjectionExecutor
QueryDSL-based implementation of ProjectionExecutor.
  • Constructor Details

    • QuerydslProjectionExecutor

      public QuerydslProjectionExecutor(com.querydsl.jpa.impl.JPAQueryFactory queryFactory, jakarta.persistence.metamodel.Metamodel metamodel, QuerydslProjectionBuilder projectionBuilder, ProjectionMetadataRegistry metadataRegistry)
      Constructs a new QuerydslProjectionExecutor with the given parameters.
      Parameters:
      queryFactory - the JPAQueryFactory to use for executing queries
      metamodel - the JPA Metamodel to use for accessing entity metadata
      projectionBuilder - the QuerydslProjectionBuilder to build projection expressions
      metadataRegistry - the ProjectionMetadataRegistry to access compile-time generated metadata
  • Method Details

    • project

      public <T, D> ProjectionResult<D> project(Class<T> entityType, Class<D> dtoType, ProjectionQuery<T> query)
      Projects the given entity type into the specified DTO type using QueryDSL. The query can include filtering, sorting, and pagination.
      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 to project
      dtoType - the type of the DTO to project into
      query - the projection query containing filters, sorting, and pagination
      Returns:
      a ProjectionResult containing the projected data and total count