Skip to content

Commit 0b9e962

Browse files
committed
Update rule message for N+1 problem detection in JPA entities
1 parent 79cd8c7 commit 0b9e962

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/org/greencodeinitiative/creedengo/java/checks/AvoidNPlusOneProblemInJPAEntitiesCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@Rule(key = "GCI604")
1313
public class AvoidNPlusOneProblemInJPAEntitiesCheck extends IssuableSubscriptionVisitor {
1414

15-
protected static final String RULE_MESSAGE = " Avoid the N+1 problem: use a fetch join or eager fetching. ";
15+
protected static final String RULE_MESSAGE = " Detection of the \"N+1 problem\" on Spring Data JPA repositories ";
1616

1717
private static final String SPRING_REPOSITORY = "org.springframework.data.repository.Repository";
1818

src/test/files/AvoidNPlusOneProblemInJPAEntitiesCheckIssue.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class AvoidNPlusOneProblemInJPAEntitiesCheckIssue {
3030
public List<Author> smellGetAllAuthors() {
3131
List<Author> authors = authorRepository.findAll();
3232
for (Author author : authors) {
33-
List<Book> books = author.getBooks(); // Noncompliant {{ Avoid the N+1 problem: use a fetch join or eager fetching. }}
33+
List<Book> books = author.getBooks(); // Noncompliant {{ Detection of the "N+1 problem" on Spring Data JPA repositories }}
3434
}
3535
return authors;
3636
}

0 commit comments

Comments
 (0)