querydsl
Installation
SKILL.md
QueryDSL Rules
Overview
QueryDSL usage rules for type-safe query construction in this project.
Core principles
Key Principle: Use QueryDSL for all complex queries. Extend QuerydslRepositorySupport. Use
@QueryProjectionfor DTOs. Prefix select methods withfetch.
| Guideline | Description |
|---|---|
| Extend QuerydslRepositorySupport | All QueryDSL repositories must extend the project's support class |
QueryRepository suffix |
All QueryDSL repository classes must use QueryRepository suffix (e.g., OrderQueryRepository) |
fetch prefix |
All QueryDSL select methods must be prefixed with fetch |
@QueryProjection |
Use @QueryProjection on DTO constructors for type-safe projections |
| No associations | Use QueryDSL JOINs instead of entity associations (see skill: jpa-rules) |
Pageable for pagination |
Always accept Pageable as a parameter for paginated queries |
SearchCondition for complex filters |
Encapsulate multiple search parameters in a dedicated {Feature}SearchCondition object |