adamsaghy commented on code in PR #3515:
URL: https://github.com/apache/fineract/pull/3515#discussion_r1371808991


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/delinquency/service/DelinquencyReadPlatformServiceImpl.java:
##########
@@ -126,4 +133,18 @@ public CollectionData calculateLoanCollectionData(final 
Long loanId) {
         return collectionData;
     }
 
+    @Override
+    public Collection<LoanInstallmentDelinquencyTagData> 
retrieveLoanInstallmentsCurrentDelinquencyTag(Long loanId) {
+
+        List<LoanInstallmentDelinquencyTagData> 
loanInstallmentsDelinquencyData = new ArrayList<>();
+        List<LoanInstallmentDelinquencyTag> loanInstallmentsCurrentDelinquency 
= repositoryLoanInstallmentDelinquencyTag
+                .findByLoanId(loanId);
+        for (LoanInstallmentDelinquencyTag installmentDelinquencyTag : 
loanInstallmentsCurrentDelinquency) {

Review Comment:
   Still loading the loan for no reason. Please fetch the required 
`loanInstallmentsDelinquencyData` via the repository using JPA projections:
   
   https://www.baeldung.com/spring-data-jpa-projections



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to