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


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java:
##########
@@ -287,10 +287,12 @@ public Collection<LoanTransactionData> 
retrieveLoanTransactions(final Long loanI
             // TODO: would worth to rework in the future. It is not nice to 
fetch relations one by one... might worth to
             // give a try to get rid of native queries
             for (LoanTransactionData loanTransaction : loanTransactionData) {
-                loanTransaction
-                        
.setLoanTransactionRelations(this.retrieveLoanTransactionRelationsByLoanTransactionId(loanTransaction.getId()));
-                loanTransaction.setLoanChargePaidByList(
-                        
loanChargePaidByReadPlatformService.getLoanChargesPaidByTransactionId(loanTransaction.getId()));
+                if (loanTransaction.supportTransactionRelations()) {

Review Comment:
   An idea:
   
   1. Please create a list of loan transactions ids that were fetched in the 
loan transaction data.
   2. Use this transaction id list to fetch all the loan transaction relations 
data
   3. Use this transaction id list to fetch all the loan charge paid by data
   4. Iterate througn on loan transaction data and set from the above list the 
transaction relations and charge paid by's if applicable
   



-- 
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