Class QuerydslProjectionExecutor
java.lang.Object
nl.datasteel.crudcraft.projection.impl.querydsl.QuerydslProjectionExecutor
- All Implemented Interfaces:
ProjectionExecutor
QueryDSL-based implementation of
ProjectionExecutor
.-
Constructor Summary
ConstructorsConstructorDescriptionQuerydslProjectionExecutor
(com.querydsl.jpa.impl.JPAQueryFactory queryFactory, jakarta.persistence.metamodel.Metamodel metamodel, QuerydslProjectionBuilder projectionBuilder, ProjectionMetadataRegistry metadataRegistry) Constructs a new QuerydslProjectionExecutor with the given parameters. -
Method Summary
Modifier and TypeMethodDescription<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.
-
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 queriesmetamodel
- the JPA Metamodel to use for accessing entity metadataprojectionBuilder
- the QuerydslProjectionBuilder to build projection expressionsmetadataRegistry
- 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 interfaceProjectionExecutor
- Type Parameters:
T
- the type of the entityD
- the type of the DTO- Parameters:
entityType
- the type of the entity to projectdtoType
- the type of the DTO to project intoquery
- the projection query containing filters, sorting, and pagination- Returns:
- a ProjectionResult containing the projected data and total count
-