mirror of
https://github.com/sanjeed5/awesome-cursor-rules-mdc.git
synced 2026-11-30 23:04:59 +08:00
rename folder
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
---
|
||||
description: Governs the structure and functionality of repository classes, emphasizing the use of JpaRepository, JPQL queries, and EntityGraphs to prevent N+1 problems.
|
||||
globs: **/src/main/java/com/example/repositories/*.java
|
||||
---
|
||||
- Must annotate repository classes with @Repository.
|
||||
- Repository classes must be of type interface.
|
||||
- Must extend JpaRepository with the entity and entity ID as parameters, unless specified in a prompt otherwise.
|
||||
- Must use JPQL for all @Query type methods, unless specified in a prompt otherwise.
|
||||
- Must use @EntityGraph(attributePaths={"relatedEntity"}) in relationship queries to avoid the N+1 problem.
|
||||
- Must use a DTO as The data container for multi-join queries with @Query.
|
||||
Reference in New Issue
Block a user