Skip to content

Commit

Permalink
Merge pull request apache#536 from vishwasbabu/develop
Browse files Browse the repository at this point in the history
FINERACT-717
  • Loading branch information
vishwasbabu authored Mar 2, 2019
2 parents d4d5427 + fd8121f commit 414893c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void testSchedulerJobs() throws InterruptedException {
Thread.sleep(15000);
schedulerJob = this.schedulerJobHelper.getSchedulerJobById(this.requestSpec, this.responseSpec, jobId.toString());
Assert.assertNotNull(schedulerJob);
System.out.println("Job is Still Running");
System.out.println("Job " +jobId.toString() +" is Still Running");
}
ArrayList<HashMap> jobHistoryData = this.schedulerJobHelper.getSchedulerJobHistory(this.requestSpec, this.responseSpec,
jobId.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import org.apache.fineract.portfolio.savings.DepositAccountType;
import org.apache.fineract.portfolio.savings.exception.SavingsAccountNotFoundException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand Down Expand Up @@ -79,8 +81,15 @@ public List<SavingsAccount> findSavingAccountByStatus(@Param("status") Integer s
loadLazyCollections(accounts);
return accounts ;
}

@Transactional(readOnly=true)
public Page<SavingsAccount> findByStatus(Integer status, Pageable pageable) {
Page<SavingsAccount> accounts = this.repository.findByStatus(status, pageable);
loadLazyCollections(accounts);
return accounts;
}

//Root Entities are enough
//Root Entities are enough
public List<SavingsAccount> findByClientIdAndGroupId(@Param("clientId") Long clientId, @Param("groupId") Long groupId) {
return this.repository.findByClientIdAndGroupId(clientId, groupId) ;
}
Expand Down Expand Up @@ -118,4 +127,10 @@ private void loadLazyCollections(final List<SavingsAccount> accounts) {
}
}
}

private void loadLazyCollections(Page<SavingsAccount> accounts) {
for (SavingsAccount account : accounts) {
account.loadLazyCollections();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.fineract.portfolio.savings.domain.SavingsAccount;
import org.apache.fineract.portfolio.savings.domain.SavingsAccountAssembler;
import org.apache.fineract.portfolio.savings.domain.SavingsAccountRepository;
import org.apache.fineract.portfolio.savings.domain.SavingsAccountRepositoryWrapper;
import org.apache.fineract.portfolio.savings.domain.SavingsAccountStatusType;
import org.joda.time.LocalDate;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -40,12 +41,12 @@ public class SavingsSchedularServiceImpl implements SavingsSchedularService {
private final SavingsAccountAssembler savingAccountAssembler;
private final SavingsAccountWritePlatformService savingsAccountWritePlatformService;
private final SavingsAccountReadPlatformService savingAccountReadPlatformService;
private final SavingsAccountRepository savingsAccountRepository;
private final SavingsAccountRepositoryWrapper savingsAccountRepository;

@Autowired
public SavingsSchedularServiceImpl(final SavingsAccountAssembler savingAccountAssembler,
final SavingsAccountWritePlatformService savingsAccountWritePlatformService,
final SavingsAccountReadPlatformService savingAccountReadPlatformService, final SavingsAccountRepository savingsAccountRepository) {
final SavingsAccountReadPlatformService savingAccountReadPlatformService, final SavingsAccountRepositoryWrapper savingsAccountRepository) {
this.savingAccountAssembler = savingAccountAssembler;
this.savingsAccountWritePlatformService = savingsAccountWritePlatformService;
this.savingAccountReadPlatformService = savingAccountReadPlatformService;
Expand Down

0 comments on commit 414893c

Please sign in to comment.