FINERACT-1550: Fix repetitive JdbcTemplate/RoutingDataSource injection

This commit is contained in:
Aleksandar Vidakovic
2022-03-27 08:00:10 +02:00
committed by Aleksandar Vidakovic
parent 863d70c081
commit a20d586c84
150 changed files with 371 additions and 483 deletions
@@ -26,7 +26,6 @@ import java.util.List;
import org.apache.fineract.accounting.closure.data.GLClosureData;
import org.apache.fineract.accounting.closure.exception.GLClosureNotFoundException;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
@@ -39,8 +38,8 @@ public class GLClosureReadPlatformServiceImpl implements GLClosureReadPlatformSe
private final JdbcTemplate jdbcTemplate;
@Autowired
public GLClosureReadPlatformServiceImpl(final RoutingDataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public GLClosureReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
private static final class GLClosureMapper implements RowMapper<GLClosureData> {
@@ -29,7 +29,6 @@ import org.apache.fineract.accounting.financialactivityaccount.data.FinancialAct
import org.apache.fineract.accounting.financialactivityaccount.exception.FinancialActivityAccountNotFoundException;
import org.apache.fineract.accounting.glaccount.data.GLAccountData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
@@ -44,10 +43,10 @@ public class FinancialActivityAccountReadPlatformServiceImpl implements Financia
private final AccountingDropdownReadPlatformService accountingDropdownReadPlatformService;
@Autowired
public FinancialActivityAccountReadPlatformServiceImpl(final RoutingDataSource dataSource,
public FinancialActivityAccountReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate,
final AccountingDropdownReadPlatformService accountingDropdownReadPlatformService) {
financialActivityAccountMapper = new FinancialActivityAccountMapper();
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.accountingDropdownReadPlatformService = accountingDropdownReadPlatformService;
}
@@ -34,7 +34,6 @@ import org.apache.fineract.accounting.journalentry.data.JournalEntryAssociationP
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
@@ -48,8 +47,8 @@ public class GLAccountReadPlatformServiceImpl implements GLAccountReadPlatformSe
private static final String nameDecoratedBaseOnHierarchy = "concat(substring('........................................', 1, ((LENGTH(hierarchy) - LENGTH(REPLACE(hierarchy, '.', '')) - 1) * 4)), name)";
@Autowired
public GLAccountReadPlatformServiceImpl(final RoutingDataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public GLAccountReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
private static final class GLAccountMapper implements RowMapper<GLAccountData> {
@@ -44,7 +44,6 @@ import org.apache.fineract.infrastructure.core.api.JsonCommand;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResultBuilder;
import org.apache.fineract.infrastructure.core.exception.PlatformDataIntegrityException;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -70,12 +69,12 @@ public class GLAccountWritePlatformServiceJpaRepositoryImpl implements GLAccount
@Autowired
public GLAccountWritePlatformServiceJpaRepositoryImpl(final GLAccountRepository glAccountRepository,
final JournalEntryRepository glJournalEntryRepository, final GLAccountCommandFromApiJsonDeserializer fromApiJsonDeserializer,
final CodeValueRepositoryWrapper codeValueRepositoryWrapper, final RoutingDataSource dataSource) {
final CodeValueRepositoryWrapper codeValueRepositoryWrapper, final JdbcTemplate jdbcTemplate) {
this.glAccountRepository = glAccountRepository;
this.glJournalEntryRepository = glJournalEntryRepository;
this.fromApiJsonDeserializer = fromApiJsonDeserializer;
this.codeValueRepositoryWrapper = codeValueRepositoryWrapper;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
}
@Transactional
@@ -26,7 +26,6 @@ import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import javax.sql.DataSource;
import org.apache.commons.lang3.StringUtils;
import org.apache.fineract.accounting.closure.domain.GLClosure;
import org.apache.fineract.accounting.closure.domain.GLClosureRepository;
@@ -60,7 +59,6 @@ import org.apache.fineract.accounting.producttoaccountmapping.domain.ProductToGL
import org.apache.fineract.accounting.producttoaccountmapping.exception.ProductToGLAccountMappingNotFoundException;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.exception.PlatformDataIntegrityException;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.organisation.monetary.data.CurrencyData;
import org.apache.fineract.organisation.office.domain.Office;
import org.apache.fineract.organisation.office.domain.OfficeRepositoryWrapper;
@@ -104,7 +102,6 @@ public class AccountingProcessorHelper {
private final AccountTransfersReadPlatformService accountTransfersReadPlatformService;
private final ChargeRepositoryWrapper chargeRepositoryWrapper;
private final JdbcTemplate jdbcTemplate;
private final DataSource dataSource;
private static final Logger LOG = LoggerFactory.getLogger(AccountingProcessorHelper.class);
@Autowired
@@ -116,9 +113,8 @@ public class AccountingProcessorHelper {
final AccountTransfersReadPlatformService accountTransfersReadPlatformService,
final GLAccountRepositoryWrapper accountRepositoryWrapper,
final ClientTransactionRepositoryWrapper clientTransactionRepositoryWrapper,
final ChargeRepositoryWrapper chargeRepositoryWrapper, final RoutingDataSource dataSource) {
final ChargeRepositoryWrapper chargeRepositoryWrapper, final JdbcTemplate jdbcTemplate) {
this.glJournalEntryRepository = glJournalEntryRepository;
this.dataSource = dataSource;
this.accountMappingRepository = accountMappingRepository;
this.closureRepository = closureRepository;
this.officeRepositoryWrapper = officeRepositoryWrapper;
@@ -129,7 +125,7 @@ public class AccountingProcessorHelper {
this.accountRepositoryWrapper = accountRepositoryWrapper;
this.clientTransactionRepository = clientTransactionRepositoryWrapper;
this.chargeRepositoryWrapper = chargeRepositoryWrapper;
this.jdbcTemplate = new JdbcTemplate(this.dataSource);
this.jdbcTemplate = jdbcTemplate;
}
public LoanDTO populateLoanDtoFromMap(final Map<String, Object> accountingBridgeData, final boolean cashBasedAccountingEnabled,
@@ -47,7 +47,6 @@ import org.apache.fineract.infrastructure.core.exception.GeneralPlatformDomainRu
import org.apache.fineract.infrastructure.core.service.DateUtils;
import org.apache.fineract.infrastructure.core.service.Page;
import org.apache.fineract.infrastructure.core.service.PaginationHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.SearchParameters;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.security.utils.ColumnValidator;
@@ -82,12 +81,12 @@ public class JournalEntryReadPlatformServiceImpl implements JournalEntryReadPlat
private final DatabaseSpecificSQLGenerator sqlGenerator;
@Autowired
public JournalEntryReadPlatformServiceImpl(final RoutingDataSource dataSource,
public JournalEntryReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate,
final GLAccountReadPlatformService glAccountReadPlatformService, final ColumnValidator columnValidator,
final OfficeReadPlatformService officeReadPlatformService,
final FinancialActivityAccountRepositoryWrapper financialActivityAccountRepositoryWrapper,
DatabaseSpecificSQLGenerator sqlGenerator, PaginationHelper paginationHelper) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.glAccountReadPlatformService = glAccountReadPlatformService;
this.officeReadPlatformService = officeReadPlatformService;
this.financialActivityAccountRepositoryWrapper = financialActivityAccountRepositoryWrapper;
@@ -38,7 +38,6 @@ import org.apache.fineract.infrastructure.core.data.CommandProcessingResultBuild
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.jobs.annotation.CronTarget;
import org.apache.fineract.infrastructure.jobs.service.JobName;
@@ -68,10 +67,10 @@ public class JournalEntryRunningBalanceUpdateServiceImpl implements JournalEntry
private final GLJournalEntryMapper entryMapper = new GLJournalEntryMapper();
@Autowired
public JournalEntryRunningBalanceUpdateServiceImpl(final RoutingDataSource dataSource,
public JournalEntryRunningBalanceUpdateServiceImpl(final JdbcTemplate jdbcTemplate,
final OfficeRepositoryWrapper officeRepositoryWrapper, final JournalEntryDataValidator dataValidator,
final FromJsonHelper fromApiJsonHelper, DatabaseSpecificSQLGenerator sqlGenerator) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.officeRepositoryWrapper = officeRepositoryWrapper;
this.dataValidator = dataValidator;
this.fromApiJsonHelper = fromApiJsonHelper;
@@ -37,7 +37,6 @@ import org.apache.fineract.accounting.producttoaccountmapping.data.ChargeToGLAcc
import org.apache.fineract.accounting.producttoaccountmapping.data.PaymentTypeToGLAccountMapper;
import org.apache.fineract.accounting.producttoaccountmapping.domain.PortfolioProductType;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.portfolio.charge.data.ChargeData;
import org.apache.fineract.portfolio.paymenttype.data.PaymentTypeData;
import org.springframework.beans.factory.annotation.Autowired;
@@ -51,8 +50,8 @@ public class ProductToGLAccountMappingReadPlatformServiceImpl implements Product
private final JdbcTemplate jdbcTemplate;
@Autowired
public ProductToGLAccountMappingReadPlatformServiceImpl(final RoutingDataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public ProductToGLAccountMappingReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
private static final class ProductToGLAccountMappingMapper implements RowMapper<Map<String, Object>> {
@@ -30,7 +30,6 @@ import org.apache.fineract.accounting.provisioning.data.LoanProductProvisioningE
import org.apache.fineract.accounting.provisioning.data.ProvisioningEntryData;
import org.apache.fineract.infrastructure.core.service.Page;
import org.apache.fineract.infrastructure.core.service.PaginationHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.SearchParameters;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.slf4j.Logger;
@@ -52,9 +51,9 @@ public class ProvisioningEntriesReadPlatformServiceImpl implements ProvisioningE
private final DatabaseSpecificSQLGenerator sqlGenerator;
@Autowired
public ProvisioningEntriesReadPlatformServiceImpl(final RoutingDataSource dataSource, DatabaseSpecificSQLGenerator sqlGenerator,
public ProvisioningEntriesReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate, DatabaseSpecificSQLGenerator sqlGenerator,
PaginationHelper paginationHelper) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.loanProductProvisioningEntryDataPaginationHelper = paginationHelper;
this.provisioningEntryDataPaginationHelper = paginationHelper;
this.sqlGenerator = sqlGenerator;
@@ -35,7 +35,6 @@ import org.apache.fineract.accounting.rule.exception.AccountingRuleNotFoundExcep
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.dao.EmptyResultDataAccessException;
@@ -51,9 +50,9 @@ public class AccountingRuleReadPlatformServiceImpl implements AccountingRuleRead
private final GLAccountReadPlatformService glAccountReadPlatformService;
@Autowired
public AccountingRuleReadPlatformServiceImpl(final RoutingDataSource dataSource,
public AccountingRuleReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate,
final GLAccountReadPlatformService glAccountReadPlatformService) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.glAccountReadPlatformService = glAccountReadPlatformService;
}
@@ -25,7 +25,6 @@ import java.util.Collection;
import org.apache.fineract.adhocquery.data.AdHocData;
import org.apache.fineract.adhocquery.exception.AdHocNotFoundException;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.EmptyResultDataAccessException;
@@ -41,8 +40,8 @@ public class AdHocReadPlatformServiceImpl implements AdHocReadPlatformService {
private final AdHocMapper adHocRowMapper;
@Autowired
public AdHocReadPlatformServiceImpl(final RoutingDataSource dataSource, DatabaseSpecificSQLGenerator sqlGenerator) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public AdHocReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate, DatabaseSpecificSQLGenerator sqlGenerator) {
this.jdbcTemplate = jdbcTemplate;
this.sqlGenerator = sqlGenerator;
this.adHocRowMapper = new AdHocMapper(sqlGenerator);
}
@@ -26,7 +26,6 @@ import java.util.Date;
import org.apache.fineract.adhocquery.data.AdHocData;
import org.apache.fineract.adhocquery.domain.ReportRunFrequency;
import org.apache.fineract.infrastructure.core.service.DateUtils;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.ThreadLocalContextUtil;
import org.apache.fineract.infrastructure.jobs.annotation.CronTarget;
import org.apache.fineract.infrastructure.jobs.service.JobName;
@@ -45,8 +44,8 @@ public class AdHocScheduledJobRunnerServiceImpl implements AdHocScheduledJobRunn
private final JdbcTemplate jdbcTemplate;
@Autowired
public AdHocScheduledJobRunnerServiceImpl(final RoutingDataSource dataSource, final AdHocReadPlatformService adHocReadPlatformService) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public AdHocScheduledJobRunnerServiceImpl(final JdbcTemplate jdbcTemplate, final AdHocReadPlatformService adHocReadPlatformService) {
this.jdbcTemplate = jdbcTemplate;
this.adHocReadPlatformService = adHocReadPlatformService;
}
@@ -42,7 +42,6 @@ import org.apache.fineract.infrastructure.core.exception.PlatformDataIntegrityEx
import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
import org.apache.fineract.infrastructure.core.service.Page;
import org.apache.fineract.infrastructure.core.service.PaginationHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.infrastructure.security.utils.ColumnValidator;
@@ -96,7 +95,7 @@ public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
private final ColumnValidator columnValidator;
@Autowired
public AuditReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource,
public AuditReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate,
final FromJsonHelper fromApiJsonHelper, final AppUserReadPlatformService appUserReadPlatformService,
final OfficeReadPlatformService officeReadPlatformService, final ClientReadPlatformService clientReadPlatformService,
final LoanProductReadPlatformService loanProductReadPlatformService, final StaffReadPlatformService staffReadPlatformService,
@@ -105,7 +104,7 @@ public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
final DepositProductReadPlatformService depositProductReadPlatformService, final ColumnValidator columnValidator,
DatabaseSpecificSQLGenerator sqlGenerator, PaginationHelper paginationHelper) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.fromApiJsonHelper = fromApiJsonHelper;
this.appUserReadPlatformService = appUserReadPlatformService;
this.officeReadPlatformService = officeReadPlatformService;
@@ -33,7 +33,6 @@ import org.apache.fineract.infrastructure.accountnumberformat.domain.EntityAccou
import org.apache.fineract.infrastructure.accountnumberformat.exception.AccountNumberFormatNotFoundException;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -53,8 +52,8 @@ public class AccountNumberFormatReadPlatformServiceImpl implements AccountNumber
private final AccountNumberFormatMapper accountNumberFormatMapper = new AccountNumberFormatMapper();
@Autowired
public AccountNumberFormatReadPlatformServiceImpl(final RoutingDataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public AccountNumberFormatReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
private static final class AccountNumberFormatMapper implements RowMapper<AccountNumberFormatData> {
@@ -39,7 +39,6 @@ import org.apache.fineract.infrastructure.bulkimport.importhandler.ImportHandler
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.exception.GeneralPlatformDomainRuleException;
import org.apache.fineract.infrastructure.core.service.DateUtils;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.ThreadLocalContextUtil;
import org.apache.fineract.infrastructure.documentmanagement.data.DocumentData;
import org.apache.fineract.infrastructure.documentmanagement.domain.Document;
@@ -74,13 +73,13 @@ public class BulkImportWorkbookServiceImpl implements BulkImportWorkbookService
@Autowired
public BulkImportWorkbookServiceImpl(final ApplicationContext applicationContext, final PlatformSecurityContext securityContext,
final DocumentWritePlatformService documentWritePlatformService, final DocumentRepository documentRepository,
final ImportDocumentRepository importDocumentRepository, final RoutingDataSource dataSource) {
final ImportDocumentRepository importDocumentRepository, final JdbcTemplate jdbcTemplate) {
this.applicationContext = applicationContext;
this.securityContext = securityContext;
this.documentWritePlatformService = documentWritePlatformService;
this.documentRepository = documentRepository;
this.importDocumentRepository = importDocumentRepository;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
}
@Override
@@ -38,7 +38,6 @@ import org.apache.fineract.infrastructure.campaigns.email.exception.EmailBusines
import org.apache.fineract.infrastructure.campaigns.email.exception.EmailCampaignNotFound;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.dao.EmptyResultDataAccessException;
@@ -57,8 +56,8 @@ public class EmailCampaignReadPlatformServiceImpl implements EmailCampaignReadPl
private final EmailCampaignMapper emailCampaignMapper;
@Autowired
public EmailCampaignReadPlatformServiceImpl(final RoutingDataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public EmailCampaignReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
this.businessRuleMapper = new BusinessRuleMapper();
this.emailCampaignMapper = new EmailCampaignMapper();
}
@@ -24,7 +24,6 @@ import java.util.Collection;
import org.apache.fineract.infrastructure.campaigns.email.data.EmailConfigurationData;
import org.apache.fineract.infrastructure.campaigns.email.exception.EmailConfigurationNotFoundException;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
@@ -38,8 +37,8 @@ public class EmailConfigurationReadPlatformServiceImpl implements EmailConfigura
private final EmailConfigurationRowMapper emailConfigurationRowMapper;
@Autowired
public EmailConfigurationReadPlatformServiceImpl(final RoutingDataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public EmailConfigurationReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
this.emailConfigurationRowMapper = new EmailConfigurationRowMapper();
}
@@ -34,7 +34,6 @@ import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.Page;
import org.apache.fineract.infrastructure.core.service.PaginationHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.SearchParameters;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.springframework.beans.factory.annotation.Autowired;
@@ -52,9 +51,9 @@ public class EmailReadPlatformServiceImpl implements EmailReadPlatformService {
private final PaginationHelper paginationHelper;
@Autowired
public EmailReadPlatformServiceImpl(final RoutingDataSource dataSource, DatabaseSpecificSQLGenerator sqlGenerator,
public EmailReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate, DatabaseSpecificSQLGenerator sqlGenerator,
PaginationHelper paginationHelper) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.sqlGenerator = sqlGenerator;
this.paginationHelper = paginationHelper;
}
@@ -40,7 +40,6 @@ import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.Page;
import org.apache.fineract.infrastructure.core.service.PaginationHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.SearchParameters;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.portfolio.calendar.service.CalendarDropdownReadPlatformService;
@@ -64,11 +63,11 @@ public class SmsCampaignReadPlatformServiceImpl implements SmsCampaignReadPlatfo
private final PaginationHelper paginationHelper;
@Autowired
public SmsCampaignReadPlatformServiceImpl(final RoutingDataSource dataSource,
public SmsCampaignReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate,
SmsCampaignDropdownReadPlatformService smsCampaignDropdownReadPlatformService,
final CalendarDropdownReadPlatformService calendarDropdownReadPlatformService, DatabaseSpecificSQLGenerator sqlGenerator,
PaginationHelper paginationHelper) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.sqlGenerator = sqlGenerator;
this.businessRuleMapper = new BusinessRuleMapper(sqlGenerator);
this.smsCampaignDropdownReadPlatformService = smsCampaignDropdownReadPlatformService;
@@ -23,7 +23,6 @@ import java.sql.SQLException;
import java.util.Collection;
import org.apache.fineract.infrastructure.codes.data.CodeData;
import org.apache.fineract.infrastructure.codes.exception.CodeNotFoundException;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
@@ -39,9 +38,9 @@ public class CodeReadPlatformServiceImpl implements CodeReadPlatformService {
private final PlatformSecurityContext context;
@Autowired
public CodeReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource) {
public CodeReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
}
private static final class CodeMapper implements RowMapper<CodeData> {
@@ -23,7 +23,6 @@ import java.sql.SQLException;
import java.util.Collection;
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
import org.apache.fineract.infrastructure.codes.exception.CodeValueNotFoundException;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
@@ -39,9 +38,9 @@ public class CodeValueReadPlatformServiceImpl implements CodeValueReadPlatformSe
private final PlatformSecurityContext context;
@Autowired
public CodeValueReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource) {
public CodeValueReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
}
private static final class CodeValueDataMapper implements RowMapper<CodeValueData> {
@@ -24,7 +24,6 @@ import java.util.Date;
import java.util.List;
import org.apache.fineract.infrastructure.configuration.data.GlobalConfigurationData;
import org.apache.fineract.infrastructure.configuration.data.GlobalConfigurationPropertyData;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.dataqueries.api.DataTableApiConstant;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.springframework.beans.factory.annotation.Autowired;
@@ -40,9 +39,9 @@ public class ConfigurationReadPlatformServiceImpl implements ConfigurationReadPl
private final RowMapper<GlobalConfigurationPropertyData> rm;
@Autowired
public ConfigurationReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource) {
public ConfigurationReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.rm = new GlobalConfigurationRowMapper();
}
@@ -26,7 +26,6 @@ import org.apache.fineract.infrastructure.configuration.data.ExternalServicesPro
import org.apache.fineract.infrastructure.configuration.data.S3CredentialsData;
import org.apache.fineract.infrastructure.configuration.data.SMTPCredentialsData;
import org.apache.fineract.infrastructure.configuration.exception.ExternalServiceConfigurationNotFoundException;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.gcm.domain.NotificationConfigurationData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
@@ -41,8 +40,8 @@ public class ExternalServicesPropertiesReadPlatformServiceImpl implements Extern
private final JdbcTemplate jdbcTemplate;
@Autowired
public ExternalServicesPropertiesReadPlatformServiceImpl(final RoutingDataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public ExternalServicesPropertiesReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
private static final class S3CredentialsDataExtractor implements ResultSetExtractor<S3CredentialsData> {
@@ -22,7 +22,6 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import org.apache.fineract.infrastructure.configuration.data.ExternalServicesData;
import org.apache.fineract.infrastructure.configuration.exception.ExternalServiceConfigurationNotFoundException;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
@@ -35,8 +34,8 @@ public class ExternalServicesReadPlatformServiceImpl implements ExternalServices
private final JdbcTemplate jdbcTemplate;
@Autowired
public ExternalServicesReadPlatformServiceImpl(final RoutingDataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public ExternalServicesReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
@Override
@@ -0,0 +1,39 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.infrastructure.core.config;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
@Configuration
public class JdbcConfig {
@Bean
public JdbcTemplate jdbcTemplate(RoutingDataSource dataSource) {
return new JdbcTemplate(dataSource);
}
@Bean
public NamedParameterJdbcTemplate namedParameterJdbcTemplate(RoutingDataSource dataSource) {
return new NamedParameterJdbcTemplate(dataSource);
}
}
@@ -21,7 +21,6 @@ package org.apache.fineract.infrastructure.creditbureau.data;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.creditbureau.service.CreditReportReadPlatformService;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.springframework.beans.factory.annotation.Autowired;
@@ -36,9 +35,9 @@ public class CreditReportReadPlatformServiceImpl implements CreditReportReadPlat
private final PlatformSecurityContext context;
@Autowired
public CreditReportReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource) {
public CreditReportReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
}
private static final class CreditReportDataMapper implements RowMapper<CreditReportData> {
@@ -21,7 +21,6 @@ package org.apache.fineract.infrastructure.creditbureau.service;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.creditbureau.data.CreditBureauLoanProductMappingData;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.springframework.beans.factory.annotation.Autowired;
@@ -36,10 +35,9 @@ public class CreditBureauLoanProductMappingReadPlatformServiceImpl implements Cr
private final PlatformSecurityContext context;
@Autowired
public CreditBureauLoanProductMappingReadPlatformServiceImpl(final PlatformSecurityContext context,
final RoutingDataSource dataSource) {
public CreditBureauLoanProductMappingReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
}
private static final class CreditBureauLoanProductMapper implements RowMapper<CreditBureauLoanProductMappingData> {
@@ -24,7 +24,6 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.creditbureau.data.CreditBureauConfigurationData;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.springframework.beans.factory.annotation.Autowired;
@@ -39,9 +38,9 @@ public class CreditBureauReadConfigurationServiceImpl implements CreditBureauRea
private final PlatformSecurityContext context;
@Autowired
public CreditBureauReadConfigurationServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource) {
public CreditBureauReadConfigurationServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
}
private static final class CbConfigMapper implements RowMapper<CreditBureauConfigurationData> {
@@ -21,7 +21,6 @@ package org.apache.fineract.infrastructure.creditbureau.service;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.creditbureau.data.CreditBureauData;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.springframework.beans.factory.annotation.Autowired;
@@ -36,9 +35,9 @@ public class CreditBureauReadPlatformServiceImpl implements CreditBureauReadPlat
private final PlatformSecurityContext context;
@Autowired
public CreditBureauReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource) {
public CreditBureauReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
}
private static final class CBMapper implements RowMapper<CreditBureauData> {
@@ -35,7 +35,6 @@ import org.apache.fineract.infrastructure.core.data.DataValidatorBuilder;
import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException;
import org.apache.fineract.infrastructure.core.exception.PlatformDataIntegrityException;
import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.creditbureau.data.CreditBureauConfigurations;
import org.apache.fineract.infrastructure.creditbureau.data.CreditBureauReportData;
import org.apache.fineract.infrastructure.creditbureau.domain.CreditBureau;
@@ -68,9 +67,8 @@ public class CreditReportWritePlatformServiceImpl implements CreditReportWritePl
.resource("creditBureauIntegration");
@Autowired
public CreditReportWritePlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource,
final FromJsonHelper fromApiJsonHelper, final TokenRepositoryWrapper tokenRepository,
final CreditBureauConfigurationRepositoryWrapper configDataRepository,
public CreditReportWritePlatformServiceImpl(final PlatformSecurityContext context, final FromJsonHelper fromApiJsonHelper,
final TokenRepositoryWrapper tokenRepository, final CreditBureauConfigurationRepositoryWrapper configDataRepository,
final CreditBureauTokenCommandFromApiJsonDeserializer fromApiJsonDeserializer,
final CreditBureauLoanProductMappingRepository loanProductMappingRepository,
final CreditBureauRepository creditBureauRepository, final CreditReportRepository creditReportRepository,
@@ -21,7 +21,6 @@ package org.apache.fineract.infrastructure.creditbureau.service;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.creditbureau.data.OrganisationCreditBureauData;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.springframework.beans.factory.annotation.Autowired;
@@ -36,9 +35,9 @@ public class OrganisationCreditBureauReadPlatformServiceImpl implements Organisa
private final PlatformSecurityContext context;
@Autowired
public OrganisationCreditBureauReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource) {
public OrganisationCreditBureauReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
}
private static final class OrganisationCreditBureauMapper implements RowMapper<OrganisationCreditBureauData> {
@@ -28,7 +28,6 @@ import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.Page;
import org.apache.fineract.infrastructure.core.service.PaginationHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.SearchParameters;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.dataqueries.data.DatatableCheckStatusData;
@@ -63,14 +62,14 @@ public class EntityDatatableChecksReadPlatformServiceImpl implements EntityDatat
private final PaginationHelper paginationHelper;
@Autowired
public EntityDatatableChecksReadPlatformServiceImpl(final RoutingDataSource dataSource,
public EntityDatatableChecksReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate,
final LoanProductReadPlatformService loanProductReadPlatformService,
final SavingsProductReadPlatformService savingsProductReadPlatformService,
final EntityDatatableChecksRepository entityDatatableChecksRepository,
final ReadWriteNonCoreDataService readWriteNonCoreDataService, DatabaseSpecificSQLGenerator sqlGenerator,
PaginationHelper paginationHelper) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.sqlGenerator = sqlGenerator;
this.registerDataTableMapper = new RegisterDataTableMapper();
this.entityDataTableChecksMapper = new EntityDataTableChecksMapper();
@@ -54,8 +54,9 @@ public class GenericDataServiceImpl implements GenericDataService {
private static final Logger LOG = LoggerFactory.getLogger(GenericDataServiceImpl.class);
@Autowired
public GenericDataServiceImpl(final RoutingDataSource dataSource, DatabaseSpecificSQLGenerator sqlGenerator,
DatabaseTypeResolver databaseTypeResolver, DatabaseIndependentQueryService databaseIndependentQueryService) {
public GenericDataServiceImpl(final RoutingDataSource dataSource, final JdbcTemplate jdbcTemplate,
DatabaseSpecificSQLGenerator sqlGenerator, DatabaseTypeResolver databaseTypeResolver,
DatabaseIndependentQueryService databaseIndependentQueryService) {
this.dataSource = dataSource;
this.sqlGenerator = sqlGenerator;
this.databaseTypeResolver = databaseTypeResolver;
@@ -36,11 +36,9 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import javax.sql.DataSource;
import javax.ws.rs.core.StreamingOutput;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.exception.PlatformDataIntegrityException;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.dataqueries.data.GenericResultsetData;
import org.apache.fineract.infrastructure.dataqueries.data.ReportData;
import org.apache.fineract.infrastructure.dataqueries.data.ReportParameterData;
@@ -65,16 +63,14 @@ public class ReadReportingServiceImpl implements ReadReportingService {
private static final Logger LOG = LoggerFactory.getLogger(ReadReportingServiceImpl.class);
private final JdbcTemplate jdbcTemplate;
private final DataSource dataSource;
private final PlatformSecurityContext context;
private final GenericDataService genericDataService;
@Autowired
public ReadReportingServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource,
public ReadReportingServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate,
final GenericDataService genericDataService) {
this.context = context;
this.dataSource = dataSource;
this.jdbcTemplate = new JdbcTemplate(this.dataSource);
this.jdbcTemplate = jdbcTemplate;
this.genericDataService = genericDataService;
}
@@ -36,7 +36,6 @@ import java.util.Locale;
import java.util.Map;
import java.util.Set;
import javax.persistence.PersistenceException;
import javax.sql.DataSource;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
@@ -55,7 +54,6 @@ import org.apache.fineract.infrastructure.core.exception.PlatformServiceUnavaila
import org.apache.fineract.infrastructure.core.serialization.DatatableCommandFromApiJsonDeserializer;
import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
import org.apache.fineract.infrastructure.core.serialization.JsonParserHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.core.service.database.DatabaseTypeResolver;
import org.apache.fineract.infrastructure.dataqueries.api.DataTableApiConstant;
@@ -107,7 +105,6 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
"mediumblob", "mediumtext", "longblob", "longtext");
private final JdbcTemplate jdbcTemplate;
private final DataSource dataSource;
private final DatabaseTypeResolver databaseTypeResolver;
private final DatabaseSpecificSQLGenerator sqlGenerator;
private final PlatformSecurityContext context;
@@ -125,15 +122,14 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
// configurationWriteService;
@Autowired(required = true)
public ReadWriteNonCoreDataServiceImpl(final RoutingDataSource dataSource, final PlatformSecurityContext context,
final FromJsonHelper fromJsonHelper, final GenericDataService genericDataService,
public ReadWriteNonCoreDataServiceImpl(final JdbcTemplate jdbcTemplate, final NamedParameterJdbcTemplate namedParameterJdbcTemplate,
final PlatformSecurityContext context, final FromJsonHelper fromJsonHelper, final GenericDataService genericDataService,
final DatatableCommandFromApiJsonDeserializer fromApiJsonDeserializer, final CodeReadPlatformService codeReadPlatformService,
final ConfigurationDomainService configurationDomainService, final DataTableValidator dataTableValidator,
final ColumnValidator columnValidator, DatabaseTypeResolver databaseTypeResolver, DatabaseSpecificSQLGenerator sqlGenerator) {
this.dataSource = dataSource;
this.databaseTypeResolver = databaseTypeResolver;
this.sqlGenerator = sqlGenerator;
this.jdbcTemplate = new JdbcTemplate(this.dataSource);
this.jdbcTemplate = jdbcTemplate;
this.context = context;
this.fromJsonHelper = fromJsonHelper;
this.helper = new JsonParserHelper();
@@ -144,7 +140,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
this.dataTableValidator = dataTableValidator;
this.columnValidator = columnValidator;
// this.configurationWriteService = configurationWriteService;
this.namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(dataSource);
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
}
@Override
@@ -22,7 +22,6 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.documentmanagement.contentrepository.ContentRepository;
import org.apache.fineract.infrastructure.documentmanagement.contentrepository.ContentRepositoryFactory;
import org.apache.fineract.infrastructure.documentmanagement.data.DocumentData;
@@ -43,10 +42,10 @@ public class DocumentReadPlatformServiceImpl implements DocumentReadPlatformServ
private final ContentRepositoryFactory contentRepositoryFactory;
@Autowired
public DocumentReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource,
public DocumentReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate,
final ContentRepositoryFactory documentStoreFactory) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.contentRepositoryFactory = documentStoreFactory;
}
@@ -21,7 +21,6 @@ package org.apache.fineract.infrastructure.documentmanagement.service;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.documentmanagement.api.ImagesApiResource.EntityTypeForImages;
import org.apache.fineract.infrastructure.documentmanagement.contentrepository.ContentRepository;
import org.apache.fineract.infrastructure.documentmanagement.contentrepository.ContentRepositoryFactory;
@@ -48,10 +47,10 @@ public class ImageReadPlatformServiceImpl implements ImageReadPlatformService {
private final StaffRepositoryWrapper staffRepositoryWrapper;
@Autowired
public ImageReadPlatformServiceImpl(final RoutingDataSource dataSource, final ContentRepositoryFactory documentStoreFactory,
public ImageReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate, final ContentRepositoryFactory documentStoreFactory,
final ClientRepositoryWrapper clientRepositoryWrapper, StaffRepositoryWrapper staffRepositoryWrapper) {
this.staffRepositoryWrapper = staffRepositoryWrapper;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.contentRepositoryFactory = documentStoreFactory;
this.clientRepositoryWrapper = clientRepositoryWrapper;
}
@@ -22,7 +22,6 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import java.util.Date;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.entityaccess.data.FineractEntityRelationData;
import org.apache.fineract.infrastructure.entityaccess.data.FineractEntityToEntityMappingData;
import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityAccessType;
@@ -48,10 +47,10 @@ public class FineractEntityAccessReadServiceImpl implements FineractEntityAccess
private final FineractEntityRelationRepositoryWrapper fineractEntityRelationRepository;
@Autowired
public FineractEntityAccessReadServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource,
public FineractEntityAccessReadServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate,
final FineractEntityRelationRepositoryWrapper fineractEntityRelationRepository) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.fineractEntityRelationRepository = fineractEntityRelationRepository;
}
@@ -25,7 +25,6 @@ import java.time.ZoneId;
import java.util.Collection;
import java.util.Date;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.gcm.domain.DeviceRegistrationData;
import org.apache.fineract.infrastructure.gcm.exception.DeviceRegistrationNotFoundException;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
@@ -43,9 +42,9 @@ public class DeviceRegistrationReadPlatformServiceImpl implements DeviceRegistra
private final PlatformSecurityContext context;
@Autowired
public DeviceRegistrationReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource) {
public DeviceRegistrationReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
}
private static final class DeviceRegistrationDataMapper implements RowMapper<DeviceRegistrationData> {
@@ -24,7 +24,6 @@ import java.time.LocalDate;
import java.util.Collection;
import java.util.List;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.hooks.data.Event;
import org.apache.fineract.infrastructure.hooks.data.EventResultSetExtractor;
import org.apache.fineract.infrastructure.hooks.data.Field;
@@ -51,10 +50,10 @@ public class HookReadPlatformServiceImpl implements HookReadPlatformService {
@Autowired
public HookReadPlatformServiceImpl(final PlatformSecurityContext context, final HookRepository hookRepository,
final RoutingDataSource dataSource) {
final JdbcTemplate jdbcTemplate) {
this.context = context;
this.hookRepository = hookRepository;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
}
@Override
@@ -24,7 +24,6 @@ import java.util.Date;
import java.util.List;
import org.apache.fineract.infrastructure.core.service.Page;
import org.apache.fineract.infrastructure.core.service.PaginationHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.SearchParameters;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.jobs.data.JobDetailData;
@@ -50,9 +49,9 @@ public class SchedulerJobRunnerReadServiceImpl implements SchedulerJobRunnerRead
private final PaginationHelper paginationHelper;
@Autowired
public SchedulerJobRunnerReadServiceImpl(final RoutingDataSource dataSource, final ColumnValidator columnValidator,
public SchedulerJobRunnerReadServiceImpl(final JdbcTemplate jdbcTemplate, final ColumnValidator columnValidator,
DatabaseSpecificSQLGenerator sqlGenerator, PaginationHelper paginationHelper) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.columnValidator = columnValidator;
this.sqlGenerator = sqlGenerator;
this.paginationHelper = paginationHelper;
@@ -22,7 +22,6 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.reportmailingjob.data.ReportMailingJobConfigurationData;
import org.apache.fineract.infrastructure.reportmailingjob.exception.ReportMailingJobConfigurationNotFoundException;
import org.springframework.beans.factory.annotation.Autowired;
@@ -40,8 +39,8 @@ public class ReportMailingJobConfigurationReadPlatformServiceImpl implements Rep
* ReportMailingJobConfigurationReadPlatformServiceImpl constructor
**/
@Autowired
public ReportMailingJobConfigurationReadPlatformServiceImpl(final RoutingDataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public ReportMailingJobConfigurationReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
@Override
@@ -29,7 +29,6 @@ import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.Page;
import org.apache.fineract.infrastructure.core.service.PaginationHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.SearchParameters;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.dataqueries.data.ReportData;
@@ -54,9 +53,9 @@ public class ReportMailingJobReadPlatformServiceImpl implements ReportMailingJob
private final PaginationHelper paginationHelper;
@Autowired
public ReportMailingJobReadPlatformServiceImpl(final RoutingDataSource dataSource, final ColumnValidator columnValidator,
public ReportMailingJobReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate, final ColumnValidator columnValidator,
DatabaseSpecificSQLGenerator sqlGenerator, PaginationHelper paginationHelper) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.columnValidator = columnValidator;
this.sqlGenerator = sqlGenerator;
this.paginationHelper = paginationHelper;
@@ -26,7 +26,6 @@ import java.util.List;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.Page;
import org.apache.fineract.infrastructure.core.service.PaginationHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.SearchParameters;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.reportmailingjob.data.ReportMailingJobRunHistoryData;
@@ -46,9 +45,9 @@ public class ReportMailingJobRunHistoryReadPlatformServiceImpl implements Report
private final PaginationHelper paginationHelper;
@Autowired
public ReportMailingJobRunHistoryReadPlatformServiceImpl(final RoutingDataSource dataSource, final ColumnValidator columnValidator,
public ReportMailingJobRunHistoryReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate, final ColumnValidator columnValidator,
DatabaseSpecificSQLGenerator sqlGenerator, PaginationHelper paginationHelper) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.sqlGenerator = sqlGenerator;
this.reportMailingJobRunHistoryMapper = new ReportMailingJobRunHistoryMapper();
this.columnValidator = columnValidator;
@@ -30,7 +30,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -45,8 +44,8 @@ public class ColumnValidator {
private final JdbcTemplate jdbcTemplate;
@Autowired
public ColumnValidator(final RoutingDataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public ColumnValidator(final JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
private void validateColumn(Map<String, Set<String>> tableColumnMap) {
@@ -30,7 +30,6 @@ import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.Page;
import org.apache.fineract.infrastructure.core.service.PaginationHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.SearchParameters;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.security.utils.ColumnValidator;
@@ -54,9 +53,9 @@ public class SmsReadPlatformServiceImpl implements SmsReadPlatformService {
private final ColumnValidator columnValidator;
@Autowired
public SmsReadPlatformServiceImpl(final RoutingDataSource dataSource, final ColumnValidator columnValidator,
public SmsReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate, final ColumnValidator columnValidator,
DatabaseSpecificSQLGenerator sqlGenerator, PaginationHelper paginationHelper) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.sqlGenerator = sqlGenerator;
this.smsRowMapper = new SmsMapper();
this.columnValidator = columnValidator;
@@ -20,8 +20,6 @@ package org.apache.fineract.infrastructure.survey.service;
import java.util.ArrayList;
import java.util.List;
import javax.sql.DataSource;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.survey.data.LikeliHoodPovertyLineData;
import org.apache.fineract.infrastructure.survey.data.PovertyLineData;
import org.apache.fineract.infrastructure.survey.data.PpiPovertyLineData;
@@ -34,13 +32,10 @@ import org.springframework.stereotype.Service;
public class PovertyLineServiceImpl implements PovertyLineService {
private final JdbcTemplate jdbcTemplate;
private final DataSource dataSource;
@Autowired
PovertyLineServiceImpl(final RoutingDataSource dataSource) {
this.dataSource = dataSource;
this.jdbcTemplate = new JdbcTemplate(this.dataSource);
PovertyLineServiceImpl(final JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
@Override
@@ -20,8 +20,6 @@ package org.apache.fineract.infrastructure.survey.service;
import java.util.ArrayList;
import java.util.List;
import javax.sql.DataSource;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.survey.data.LikelihoodData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
@@ -32,13 +30,10 @@ import org.springframework.stereotype.Service;
public class ReadLikelihoodServiceImpl implements ReadLikelihoodService {
private final JdbcTemplate jdbcTemplate;
private final DataSource dataSource;
@Autowired
ReadLikelihoodServiceImpl(final RoutingDataSource dataSource) {
this.dataSource = dataSource;
this.jdbcTemplate = new JdbcTemplate(this.dataSource);
ReadLikelihoodServiceImpl(final JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
@Override
@@ -22,9 +22,7 @@ import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.sql.DataSource;
import org.apache.fineract.infrastructure.core.service.DateUtils;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.dataqueries.api.DataTableApiConstant;
import org.apache.fineract.infrastructure.dataqueries.data.DatatableData;
import org.apache.fineract.infrastructure.dataqueries.data.GenericResultsetData;
@@ -46,17 +44,15 @@ public class ReadSurveyServiceImpl implements ReadSurveyService {
private final PlatformSecurityContext context;
private final JdbcTemplate jdbcTemplate;
private final DataSource dataSource;
private final GenericDataService genericDataService;
private final ReadWriteNonCoreDataService readWriteNonCoreDataService;
@Autowired
public ReadSurveyServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource,
public ReadSurveyServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate,
final GenericDataService genericDataService, final ReadWriteNonCoreDataService readWriteNonCoreDataService) {
this.context = context;
this.dataSource = dataSource;
this.jdbcTemplate = new JdbcTemplate(this.dataSource);
this.jdbcTemplate = jdbcTemplate;
this.genericDataService = genericDataService;
this.readWriteNonCoreDataService = readWriteNonCoreDataService;
}
@@ -49,7 +49,6 @@ import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.exception.PlatformDataIntegrityException;
import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer;
import org.apache.fineract.infrastructure.core.service.DateUtils;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.interoperation.data.InteropAccountData;
@@ -150,7 +149,7 @@ public class InteropServiceImpl implements InteropService {
ApplicationCurrencyRepository applicationCurrencyRepository, NoteRepository noteRepository,
PaymentTypeRepository paymentTypeRepository, InteropIdentifierRepository identifierRepository, LoanRepository loanRepository,
SavingsHelper savingsHelper, SavingsAccountTransactionSummaryWrapper savingsAccountTransactionSummaryWrapper,
SavingsAccountDomainService savingsAccountService, final RoutingDataSource dataSource,
SavingsAccountDomainService savingsAccountService, final JdbcTemplate jdbcTemplate,
final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService,
final DefaultToApiJsonSerializer<LoanAccountData> toApiJsonSerializer, DatabaseSpecificSQLGenerator sqlGenerator) {
this.securityContext = securityContext;
@@ -165,7 +164,7 @@ public class InteropServiceImpl implements InteropService {
this.savingsHelper = savingsHelper;
this.savingsAccountTransactionSummaryWrapper = savingsAccountTransactionSummaryWrapper;
this.savingsAccountService = savingsAccountService;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.commandsSourceWritePlatformService = commandsSourceWritePlatformService;
this.toApiJsonSerializer = toApiJsonSerializer;
this.sqlGenerator = sqlGenerator;
@@ -20,7 +20,6 @@ package org.apache.fineract.mix.service;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.mix.data.MixTaxonomyMappingData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.EmptyResultDataAccessException;
@@ -34,8 +33,8 @@ public class MixTaxonomyMappingReadPlatformServiceImpl implements MixTaxonomyMap
private final JdbcTemplate jdbcTemplate;
@Autowired
public MixTaxonomyMappingReadPlatformServiceImpl(final RoutingDataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public MixTaxonomyMappingReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
private static final class TaxonomyMappingMapper implements RowMapper<MixTaxonomyMappingData> {
@@ -21,7 +21,6 @@ package org.apache.fineract.mix.service;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.mix.data.MixTaxonomyData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
@@ -35,8 +34,8 @@ public class MixTaxonomyReadPlatformServiceImpl implements MixTaxonomyReadPlatfo
private final MixTaxonomyMapper mixTaxonomyMapper;
@Autowired
public MixTaxonomyReadPlatformServiceImpl(final RoutingDataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public MixTaxonomyReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
this.mixTaxonomyMapper = new MixTaxonomyMapper();
}
@@ -20,7 +20,6 @@ package org.apache.fineract.mix.service;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.mix.data.NamespaceData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
@@ -34,8 +33,8 @@ public class NamespaceReadPlatformServiceImpl implements NamespaceReadPlatformSe
private final NamespaceMapper namespaceMapper;
@Autowired
public NamespaceReadPlatformServiceImpl(final RoutingDataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public NamespaceReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
this.namespaceMapper = new NamespaceMapper();
}
@@ -29,7 +29,6 @@ import java.util.regex.Pattern;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.mix.data.MixTaxonomyData;
import org.apache.fineract.mix.data.MixTaxonomyMappingData;
import org.apache.fineract.mix.data.XBRLData;
@@ -53,11 +52,11 @@ public class XBRLResultServiceImpl implements XBRLResultService {
private HashMap<String, BigDecimal> accountBalanceMap;
@Autowired
public XBRLResultServiceImpl(final RoutingDataSource dataSource, final MixTaxonomyMappingReadPlatformService readTaxonomyMappingService,
public XBRLResultServiceImpl(final JdbcTemplate jdbcTemplate, final MixTaxonomyMappingReadPlatformService readTaxonomyMappingService,
final MixTaxonomyReadPlatformService readTaxonomyService) {
this.readTaxonomyMappingService = readTaxonomyMappingService;
this.readTaxonomyService = readTaxonomyService;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
}
@Override
@@ -24,7 +24,6 @@ import java.util.HashMap;
import java.util.List;
import org.apache.fineract.infrastructure.core.service.Page;
import org.apache.fineract.infrastructure.core.service.PaginationHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.SearchParameters;
import org.apache.fineract.infrastructure.core.service.ThreadLocalContextUtil;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
@@ -51,9 +50,9 @@ public class NotificationReadPlatformServiceImpl implements NotificationReadPlat
private HashMap<Long, HashMap<Long, CacheNotificationResponseHeader>> tenantNotificationResponseHeaderCache = new HashMap<>();
@Autowired
public NotificationReadPlatformServiceImpl(final RoutingDataSource dataSource, final PlatformSecurityContext context,
public NotificationReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate, final PlatformSecurityContext context,
final ColumnValidator columnValidator, DatabaseSpecificSQLGenerator sqlGenerator, PaginationHelper paginationHelper) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.context = context;
this.columnValidator = columnValidator;
this.paginationHelper = paginationHelper;
@@ -21,7 +21,6 @@ package org.apache.fineract.notification.service;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.notification.data.TopicData;
import org.apache.fineract.notification.exception.TopicNotFoundException;
import org.springframework.beans.factory.annotation.Autowired;
@@ -36,8 +35,8 @@ public class TopicReadPlatformServiceImpl implements TopicReadPlatformService {
private final JdbcTemplate jdbcTemplate;
@Autowired
public TopicReadPlatformServiceImpl(final RoutingDataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public TopicReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
private static final class TopicMapper implements RowMapper<TopicData> {
@@ -23,7 +23,6 @@ import java.sql.SQLException;
import java.time.LocalDate;
import java.util.Collection;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.notification.data.TopicSubscriberData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
@@ -36,8 +35,8 @@ public class TopicSubscriberReadPlatformServiceImpl implements TopicSubscriberRe
private final JdbcTemplate jdbcTemplate;
@Autowired
public TopicSubscriberReadPlatformServiceImpl(final RoutingDataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public TopicSubscriberReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
private static final class TopicSubscriberMapper implements RowMapper<TopicSubscriberData> {
@@ -29,7 +29,6 @@ import java.util.Date;
import java.util.List;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.organisation.holiday.data.HolidayData;
import org.apache.fineract.organisation.holiday.domain.RescheduleType;
@@ -47,9 +46,9 @@ public class HolidayReadPlatformServiceImpl implements HolidayReadPlatformServic
private final JdbcTemplate jdbcTemplate;
@Autowired
public HolidayReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource) {
public HolidayReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
}
private static final class HolidayMapper implements RowMapper<HolidayData> {
@@ -22,7 +22,6 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.organisation.monetary.data.CurrencyData;
import org.springframework.beans.factory.annotation.Autowired;
@@ -38,9 +37,9 @@ public class CurrencyReadPlatformServiceImpl implements CurrencyReadPlatformServ
private final CurrencyMapper currencyRowMapper;
@Autowired
public CurrencyReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource) {
public CurrencyReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.currencyRowMapper = new CurrencyMapper();
}
@@ -26,7 +26,6 @@ import java.util.ArrayList;
import java.util.Collection;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.DateUtils;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.SearchParameters;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
@@ -56,12 +55,12 @@ public class OfficeReadPlatformServiceImpl implements OfficeReadPlatformService
@Autowired
public OfficeReadPlatformServiceImpl(final PlatformSecurityContext context,
final CurrencyReadPlatformService currencyReadPlatformService, final RoutingDataSource dataSource,
final CurrencyReadPlatformService currencyReadPlatformService, final JdbcTemplate jdbcTemplate,
final ColumnValidator columnValidator, DatabaseSpecificSQLGenerator sqlGenerator) {
this.context = context;
this.currencyReadPlatformService = currencyReadPlatformService;
this.columnValidator = columnValidator;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.sqlGenerator = sqlGenerator;
}
@@ -22,7 +22,6 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.organisation.provisioning.data.ProvisioningCategoryData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
@@ -36,8 +35,8 @@ public class ProvisioningCategoryReadPlatformServiceImpl implements Provisioning
private final ProvisioningCategoryRowMapper provisionCategoryRowMapper;
@Autowired
public ProvisioningCategoryReadPlatformServiceImpl(final RoutingDataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public ProvisioningCategoryReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
this.provisionCategoryRowMapper = new ProvisioningCategoryRowMapper();
}
@@ -25,7 +25,6 @@ import org.apache.fineract.infrastructure.core.api.JsonCommand;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResultBuilder;
import org.apache.fineract.infrastructure.core.exception.PlatformDataIntegrityException;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.organisation.provisioning.domain.ProvisioningCategory;
import org.apache.fineract.organisation.provisioning.domain.ProvisioningCategoryRepository;
import org.apache.fineract.organisation.provisioning.exception.ProvisioningCategoryCannotBeDeletedException;
@@ -52,10 +51,10 @@ public class ProvisioningCategoryWritePlatformServiceJpaRepositoryImpl implement
@Autowired
public ProvisioningCategoryWritePlatformServiceJpaRepositoryImpl(final ProvisioningCategoryRepository provisioningCategoryRepository,
final ProvisioningCategoryDefinitionJsonDeserializer fromApiJsonDeserializer, final RoutingDataSource dataSource) {
final ProvisioningCategoryDefinitionJsonDeserializer fromApiJsonDeserializer, final JdbcTemplate jdbcTemplate) {
this.provisioningCategoryRepository = provisioningCategoryRepository;
this.fromApiJsonDeserializer = fromApiJsonDeserializer;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
}
@Override
@@ -26,7 +26,6 @@ import java.util.Collection;
import java.util.List;
import org.apache.fineract.accounting.glaccount.data.GLAccountData;
import org.apache.fineract.accounting.glaccount.service.GLAccountReadPlatformService;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.organisation.provisioning.data.ProvisioningCategoryData;
import org.apache.fineract.organisation.provisioning.data.ProvisioningCriteriaData;
import org.apache.fineract.organisation.provisioning.data.ProvisioningCriteriaDefinitionData;
@@ -49,12 +48,12 @@ public class ProvisioningCriteriaReadPlatformServiceImpl implements Provisioning
private final LoanProductReadPlatformService loanProductReaPlatformService;
@Autowired
public ProvisioningCriteriaReadPlatformServiceImpl(final RoutingDataSource dataSource,
public ProvisioningCriteriaReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate,
final ProvisioningCategoryReadPlatformService provisioningCategoryReadPlatformService,
final LoanProductReadPlatformService loanProductReadPlatformService,
final GLAccountReadPlatformService glAccountReadPlatformService,
final LoanProductReadPlatformService loanProductReaPlatformService) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.provisioningCategoryReadPlatformService = provisioningCategoryReadPlatformService;
this.loanProductReadPlatformService = loanProductReadPlatformService;
this.glAccountReadPlatformService = glAccountReadPlatformService;
@@ -27,7 +27,6 @@ import java.util.List;
import java.util.Map;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.exception.UnrecognizedQueryParamException;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.infrastructure.security.utils.ColumnValidator;
import org.apache.fineract.infrastructure.security.utils.SQLBuilder;
@@ -52,10 +51,10 @@ public class StaffReadPlatformServiceImpl implements StaffReadPlatformService {
private final ColumnValidator columnValidator;
@Autowired
public StaffReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource,
public StaffReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate,
final ColumnValidator columnValidator) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.columnValidator = columnValidator;
}
@@ -25,7 +25,6 @@ import java.time.ZonedDateTime;
import java.util.Date;
import org.apache.fineract.infrastructure.core.api.JsonCommand;
import org.apache.fineract.infrastructure.core.service.DateUtils;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.SearchParameters;
import org.apache.fineract.organisation.teller.domain.Cashier;
import org.apache.fineract.organisation.teller.domain.Teller;
@@ -50,9 +49,9 @@ public class CashierTransactionDataValidator {
@Autowired
public CashierTransactionDataValidator(final TellerManagementReadPlatformService tellerManagementReadPlatformService,
final RoutingDataSource dataSource) {
final JdbcTemplate jdbcTemplate) {
this.tellerManagementReadPlatformService = tellerManagementReadPlatformService;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
}
public void validateSettleCashAndCashOutTransactions(final Long cashierId, String currencyCode, final BigDecimal transactionAmount) {
@@ -31,7 +31,6 @@ import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.exception.UnrecognizedQueryParamException;
import org.apache.fineract.infrastructure.core.service.Page;
import org.apache.fineract.infrastructure.core.service.PaginationHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.SearchParameters;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
@@ -76,12 +75,12 @@ public class TellerManagementReadPlatformServiceImpl implements TellerManagement
private final ColumnValidator columnValidator;
@Autowired
public TellerManagementReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource,
public TellerManagementReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate,
final OfficeReadPlatformService officeReadPlatformService, StaffReadPlatformService staffReadPlatformService,
final CurrencyReadPlatformService currencyReadPlatformService, final ColumnValidator columnValidator,
DatabaseSpecificSQLGenerator sqlGenerator, PaginationHelper paginationHelper) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.officeReadPlatformService = officeReadPlatformService;
this.staffReadPlatformService = staffReadPlatformService;
this.currencyReadPlatformService = currencyReadPlatformService;
@@ -24,7 +24,6 @@ import java.util.Arrays;
import java.util.Collection;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.organisation.workingdays.data.WorkingDaysData;
import org.apache.fineract.organisation.workingdays.domain.RepaymentRescheduleType;
import org.apache.fineract.organisation.workingdays.domain.WorkingDaysEnumerations;
@@ -41,8 +40,8 @@ public class WorkingDaysReadPlatformServiceImpl implements WorkingDaysReadPlatfo
private final JdbcTemplate jdbcTemplate;
@Autowired
public WorkingDaysReadPlatformServiceImpl(final RoutingDataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public WorkingDaysReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
private static final class WorkingDaysMapper implements RowMapper<WorkingDaysData> {
@@ -24,7 +24,6 @@ import java.util.Collection;
import java.util.List;
import java.util.Map;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.portfolio.account.data.AccountAssociationsData;
import org.apache.fineract.portfolio.account.data.PortfolioAccountData;
import org.apache.fineract.portfolio.account.domain.AccountAssociationType;
@@ -45,8 +44,8 @@ public class AccountAssociationsReadPlatformServiceImpl implements AccountAssoci
private final JdbcTemplate jdbcTemplate;
@Autowired
public AccountAssociationsReadPlatformServiceImpl(final RoutingDataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public AccountAssociationsReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
@Override
@@ -33,7 +33,6 @@ import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.DateUtils;
import org.apache.fineract.infrastructure.core.service.Page;
import org.apache.fineract.infrastructure.core.service.PaginationHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.SearchParameters;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.security.utils.ColumnValidator;
@@ -73,11 +72,11 @@ public class AccountTransfersReadPlatformServiceImpl implements AccountTransfers
private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
@Autowired
public AccountTransfersReadPlatformServiceImpl(final RoutingDataSource dataSource,
public AccountTransfersReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate,
final ClientReadPlatformService clientReadPlatformService, final OfficeReadPlatformService officeReadPlatformService,
final PortfolioAccountReadPlatformService portfolioAccountReadPlatformService, final ColumnValidator columnValidator,
DatabaseSpecificSQLGenerator sqlGenerator, PaginationHelper paginationHelper) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.clientReadPlatformService = clientReadPlatformService;
this.officeReadPlatformService = officeReadPlatformService;
this.portfolioAccountReadPlatformService = portfolioAccountReadPlatformService;
@@ -25,7 +25,6 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.organisation.monetary.data.CurrencyData;
import org.apache.fineract.portfolio.account.PortfolioAccountType;
@@ -49,8 +48,8 @@ public class PortfolioAccountReadPlatformServiceImpl implements PortfolioAccount
private final PortfolioLoanAccountRefundByTransferMapper accountRefundByTransferMapper;
@Autowired
public PortfolioAccountReadPlatformServiceImpl(final RoutingDataSource dataSource, DatabaseSpecificSQLGenerator sqlGenerator) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public PortfolioAccountReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate, DatabaseSpecificSQLGenerator sqlGenerator) {
this.jdbcTemplate = jdbcTemplate;
this.savingsAccountMapper = new PortfolioSavingsAccountMapper();
this.loanAccountMapper = new PortfolioLoanAccountMapper();
this.accountRefundByTransferMapper = new PortfolioLoanAccountRefundByTransferMapper(sqlGenerator);
@@ -32,7 +32,6 @@ import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.Page;
import org.apache.fineract.infrastructure.core.service.PaginationHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.SearchParameters;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.security.utils.ColumnValidator;
@@ -61,9 +60,9 @@ public class StandingInstructionHistoryReadPlatformServiceImpl implements Standi
private final PaginationHelper paginationHelper;
@Autowired
public StandingInstructionHistoryReadPlatformServiceImpl(final RoutingDataSource dataSource, final ColumnValidator columnValidator,
public StandingInstructionHistoryReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate, final ColumnValidator columnValidator,
DatabaseSpecificSQLGenerator sqlGenerator, PaginationHelper paginationHelper) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.sqlGenerator = sqlGenerator;
this.standingInstructionHistoryMapper = new StandingInstructionHistoryMapper();
this.columnValidator = columnValidator;
@@ -39,7 +39,6 @@ import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.DateUtils;
import org.apache.fineract.infrastructure.core.service.Page;
import org.apache.fineract.infrastructure.core.service.PaginationHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.SearchParameters;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.security.utils.ColumnValidator;
@@ -86,12 +85,12 @@ public class StandingInstructionReadPlatformServiceImpl implements StandingInstr
private final PaginationHelper paginationHelper;
@Autowired
public StandingInstructionReadPlatformServiceImpl(final RoutingDataSource dataSource,
public StandingInstructionReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate,
final ClientReadPlatformService clientReadPlatformService, final OfficeReadPlatformService officeReadPlatformService,
final PortfolioAccountReadPlatformService portfolioAccountReadPlatformService,
final DropdownReadPlatformService dropdownReadPlatformService, final ColumnValidator columnValidator,
DatabaseSpecificSQLGenerator sqlGenerator, PaginationHelper paginationHelper) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.clientReadPlatformService = clientReadPlatformService;
this.officeReadPlatformService = officeReadPlatformService;
this.portfolioAccountReadPlatformService = portfolioAccountReadPlatformService;
@@ -39,7 +39,6 @@ import org.apache.fineract.infrastructure.core.exception.AbstractPlatformService
import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException;
import org.apache.fineract.infrastructure.core.exception.PlatformDataIntegrityException;
import org.apache.fineract.infrastructure.core.service.DateUtils;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.jobs.annotation.CronTarget;
import org.apache.fineract.infrastructure.jobs.exception.JobExecutionException;
@@ -94,7 +93,7 @@ public class StandingInstructionWritePlatformServiceImpl implements StandingInst
final AccountTransferDetailRepository accountTransferDetailRepository,
final StandingInstructionRepository standingInstructionRepository,
final StandingInstructionReadPlatformService standingInstructionReadPlatformService,
final AccountTransfersWritePlatformService accountTransfersWritePlatformService, final RoutingDataSource dataSource,
final AccountTransfersWritePlatformService accountTransfersWritePlatformService, final JdbcTemplate jdbcTemplate,
DatabaseSpecificSQLGenerator sqlGenerator) {
this.standingInstructionDataValidator = standingInstructionDataValidator;
this.standingInstructionAssembler = standingInstructionAssembler;
@@ -102,7 +101,7 @@ public class StandingInstructionWritePlatformServiceImpl implements StandingInst
this.standingInstructionRepository = standingInstructionRepository;
this.standingInstructionReadPlatformService = standingInstructionReadPlatformService;
this.accountTransfersWritePlatformService = accountTransfersWritePlatformService;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.sqlGenerator = sqlGenerator;
}
@@ -26,7 +26,6 @@ import java.util.Collection;
import java.util.List;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.security.utils.ColumnValidator;
import org.apache.fineract.organisation.monetary.data.CurrencyData;
import org.apache.fineract.portfolio.accountdetails.data.AccountSummaryCollectionData;
@@ -61,10 +60,10 @@ public class AccountDetailsReadPlatformServiceJpaRepositoryImpl implements Accou
@Autowired
public AccountDetailsReadPlatformServiceJpaRepositoryImpl(final ClientReadPlatformService clientReadPlatformService,
final RoutingDataSource dataSource, final GroupReadPlatformService groupReadPlatformService,
final JdbcTemplate jdbcTemplate, final GroupReadPlatformService groupReadPlatformService,
final ColumnValidator columnValidator) {
this.clientReadPlatformService = clientReadPlatformService;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.groupReadPlatformService = groupReadPlatformService;
this.columnValidator = columnValidator;
}
@@ -27,7 +27,6 @@ import java.util.Date;
import java.util.List;
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
import org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformService;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.portfolio.address.data.AddressData;
import org.springframework.beans.factory.annotation.Autowired;
@@ -43,10 +42,10 @@ public class AddressReadPlatformServiceImpl implements AddressReadPlatformServic
private final CodeValueReadPlatformService readService;
@Autowired
public AddressReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource,
public AddressReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate,
final CodeValueReadPlatformService readService) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.readService = readService;
}
@@ -22,7 +22,6 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import java.util.List;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.portfolio.address.data.FieldConfigurationData;
import org.springframework.beans.factory.annotation.Autowired;
@@ -37,9 +36,9 @@ public class FieldConfigurationReadPlatformServiceImpl implements FieldConfigura
private final PlatformSecurityContext context;
@Autowired
public FieldConfigurationReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource) {
public FieldConfigurationReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
}
private static final class FieldMapper implements RowMapper<FieldConfigurationData> {
@@ -31,7 +31,6 @@ import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDoma
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.DateUtils;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.portfolio.calendar.data.CalendarData;
import org.apache.fineract.portfolio.calendar.domain.CalendarEntityType;
import org.apache.fineract.portfolio.calendar.domain.CalendarType;
@@ -51,9 +50,8 @@ public class CalendarReadPlatformServiceImpl implements CalendarReadPlatformServ
private final ConfigurationDomainService configurationDomainService;
@Autowired
public CalendarReadPlatformServiceImpl(final RoutingDataSource dataSource,
final ConfigurationDomainService configurationDomainService) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public CalendarReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate, final ConfigurationDomainService configurationDomainService) {
this.jdbcTemplate = jdbcTemplate;
this.configurationDomainService = configurationDomainService;
}
@@ -32,7 +32,6 @@ import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDoma
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.DateUtils;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityType;
import org.apache.fineract.infrastructure.entityaccess.service.FineractEntityAccessUtil;
import org.apache.fineract.organisation.monetary.data.CurrencyData;
@@ -73,17 +72,18 @@ public class ChargeReadPlatformServiceImpl implements ChargeReadPlatformService
@Autowired
public ChargeReadPlatformServiceImpl(final CurrencyReadPlatformService currencyReadPlatformService,
final ChargeDropdownReadPlatformService chargeDropdownReadPlatformService, final RoutingDataSource dataSource,
final ChargeDropdownReadPlatformService chargeDropdownReadPlatformService, final JdbcTemplate jdbcTemplate,
final DropdownReadPlatformService dropdownReadPlatformService, final FineractEntityAccessUtil fineractEntityAccessUtil,
final AccountingDropdownReadPlatformService accountingDropdownReadPlatformService,
final TaxReadPlatformService taxReadPlatformService, final ConfigurationDomainServiceJpa configurationDomainServiceJpa) {
final TaxReadPlatformService taxReadPlatformService, final ConfigurationDomainServiceJpa configurationDomainServiceJpa,
final NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
this.chargeDropdownReadPlatformService = chargeDropdownReadPlatformService;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.currencyReadPlatformService = currencyReadPlatformService;
this.dropdownReadPlatformService = dropdownReadPlatformService;
this.fineractEntityAccessUtil = fineractEntityAccessUtil;
this.accountingDropdownReadPlatformService = accountingDropdownReadPlatformService;
this.namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(dataSource);
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
this.taxReadPlatformService = taxReadPlatformService;
this.configurationDomainServiceJpa = configurationDomainServiceJpa;
}
@@ -21,7 +21,6 @@ package org.apache.fineract.portfolio.charge.service;
import java.util.Collection;
import java.util.Map;
import javax.persistence.PersistenceException;
import javax.sql.DataSource;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.fineract.accounting.glaccount.domain.GLAccount;
import org.apache.fineract.accounting.glaccount.domain.GLAccountRepositoryWrapper;
@@ -29,7 +28,6 @@ import org.apache.fineract.infrastructure.core.api.JsonCommand;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResultBuilder;
import org.apache.fineract.infrastructure.core.exception.PlatformDataIntegrityException;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.entityaccess.domain.FineractEntityAccessType;
import org.apache.fineract.infrastructure.entityaccess.service.FineractEntityAccessUtil;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
@@ -64,7 +62,6 @@ public class ChargeWritePlatformServiceJpaRepositoryImpl implements ChargeWriteP
private final PlatformSecurityContext context;
private final ChargeDefinitionCommandFromApiJsonDeserializer fromApiJsonDeserializer;
private final JdbcTemplate jdbcTemplate;
private final DataSource dataSource;
private final ChargeRepository chargeRepository;
private final LoanProductRepository loanProductRepository;
private final FineractEntityAccessUtil fineractEntityAccessUtil;
@@ -75,13 +72,12 @@ public class ChargeWritePlatformServiceJpaRepositoryImpl implements ChargeWriteP
@Autowired
public ChargeWritePlatformServiceJpaRepositoryImpl(final PlatformSecurityContext context,
final ChargeDefinitionCommandFromApiJsonDeserializer fromApiJsonDeserializer, final ChargeRepository chargeRepository,
final LoanProductRepository loanProductRepository, final RoutingDataSource dataSource,
final LoanProductRepository loanProductRepository, final JdbcTemplate jdbcTemplate,
final FineractEntityAccessUtil fineractEntityAccessUtil, final GLAccountRepositoryWrapper glAccountRepository,
final TaxGroupRepositoryWrapper taxGroupRepository, final PaymentTypeRepositoryWrapper paymentTyperepositoryWrapper) {
this.context = context;
this.fromApiJsonDeserializer = fromApiJsonDeserializer;
this.dataSource = dataSource;
this.jdbcTemplate = new JdbcTemplate(this.dataSource);
this.jdbcTemplate = jdbcTemplate;
this.chargeRepository = chargeRepository;
this.loanProductRepository = loanProductRepository;
this.fineractEntityAccessUtil = fineractEntityAccessUtil;
@@ -21,7 +21,6 @@ package org.apache.fineract.portfolio.client.service;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.portfolio.address.data.ClientAddressData;
import org.springframework.beans.factory.annotation.Autowired;
@@ -36,9 +35,9 @@ public class ClientAddressReadPlatformServiceImpl implements ClientAddressReadPl
private final PlatformSecurityContext context;
@Autowired
public ClientAddressReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource) {
public ClientAddressReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
}
private static final class ClientAddrMapper implements RowMapper<ClientAddressData> {
@@ -27,7 +27,6 @@ import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.Page;
import org.apache.fineract.infrastructure.core.service.PaginationHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.SearchParameters;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
@@ -53,10 +52,10 @@ public class ClientChargeReadPlatformServiceImpl implements ClientChargeReadPlat
private final ClientChargeMapper clientChargeMapper;
@Autowired
public ClientChargeReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource,
public ClientChargeReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate,
DatabaseSpecificSQLGenerator sqlGenerator, PaginationHelper paginationHelper) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.sqlGenerator = sqlGenerator;
this.clientChargeMapper = new ClientChargeMapper();
this.paginationHelper = paginationHelper;
@@ -27,7 +27,6 @@ import java.util.List;
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
import org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformService;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.portfolio.client.data.ClientFamilyMembersData;
import org.springframework.beans.factory.annotation.Autowired;
@@ -43,10 +42,10 @@ public class ClientFamilyMembersReadPlatformServiceImpl implements ClientFamilyM
private final CodeValueReadPlatformService codeValueReadPlatformService;
@Autowired
public ClientFamilyMembersReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource,
public ClientFamilyMembersReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate,
final CodeValueReadPlatformService codeValueReadPlatformService) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.codeValueReadPlatformService = codeValueReadPlatformService;
}
@@ -23,7 +23,6 @@ import java.sql.SQLException;
import java.util.Collection;
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.portfolio.client.data.ClientIdentifierData;
import org.apache.fineract.portfolio.client.domain.ClientIdentifierStatus;
@@ -42,9 +41,9 @@ public class ClientIdentifierReadPlatformServiceImpl implements ClientIdentifier
private final PlatformSecurityContext context;
@Autowired
public ClientIdentifierReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource) {
public ClientIdentifierReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
}
@Override
@@ -41,7 +41,6 @@ import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidati
import org.apache.fineract.infrastructure.core.service.DateUtils;
import org.apache.fineract.infrastructure.core.service.Page;
import org.apache.fineract.infrastructure.core.service.PaginationHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.SearchParameters;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.dataqueries.data.DatatableData;
@@ -104,7 +103,7 @@ public class ClientReadPlatformServiceImpl implements ClientReadPlatformService
private final ClientCollateralManagementRepositoryWrapper clientCollateralManagementRepositoryWrapper;
@Autowired
public ClientReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource,
public ClientReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate,
final OfficeReadPlatformService officeReadPlatformService, final StaffReadPlatformService staffReadPlatformService,
final CodeValueReadPlatformService codeValueReadPlatformService,
final SavingsProductReadPlatformService savingsProductReadPlatformService,
@@ -116,7 +115,7 @@ public class ClientReadPlatformServiceImpl implements ClientReadPlatformService
DatabaseSpecificSQLGenerator sqlGenerator, PaginationHelper paginationHelper) {
this.context = context;
this.officeReadPlatformService = officeReadPlatformService;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.staffReadPlatformService = staffReadPlatformService;
this.codeValueReadPlatformService = codeValueReadPlatformService;
this.savingsProductReadPlatformService = savingsProductReadPlatformService;
@@ -27,7 +27,6 @@ import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.Page;
import org.apache.fineract.infrastructure.core.service.PaginationHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.SearchParameters;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.organisation.monetary.data.CurrencyData;
@@ -52,9 +51,9 @@ public class ClientTransactionReadPlatformServiceImpl implements ClientTransacti
private final PaginationHelper paginationHelper;
@Autowired
public ClientTransactionReadPlatformServiceImpl(final RoutingDataSource dataSource, DatabaseSpecificSQLGenerator sqlGenerator,
public ClientTransactionReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate, DatabaseSpecificSQLGenerator sqlGenerator,
PaginationHelper paginationHelper) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.sqlGenerator = sqlGenerator;
this.clientTransactionMapper = new ClientTransactionMapper();
this.paginationHelper = paginationHelper;
@@ -24,7 +24,6 @@ import java.sql.SQLException;
import java.util.List;
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.organisation.monetary.data.CurrencyData;
import org.apache.fineract.portfolio.collateral.data.CollateralData;
@@ -44,10 +43,10 @@ public class CollateralReadPlatformServiceImpl implements CollateralReadPlatform
private final LoanRepositoryWrapper loanRepositoryWrapper;
@Autowired
public CollateralReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource,
public CollateralReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate,
final LoanRepositoryWrapper loanRepositoryWrapper) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.loanRepositoryWrapper = loanRepositoryWrapper;
}
@@ -41,7 +41,6 @@ import org.apache.fineract.infrastructure.configuration.domain.ConfigurationDoma
import org.apache.fineract.infrastructure.core.api.JsonQuery;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.organisation.monetary.data.CurrencyData;
@@ -85,7 +84,7 @@ import org.springframework.stereotype.Service;
public class CollectionSheetReadPlatformServiceImpl implements CollectionSheetReadPlatformService {
private final PlatformSecurityContext context;
private final NamedParameterJdbcTemplate namedParameterjdbcTemplate;
private final NamedParameterJdbcTemplate namedParameterJdbcTemplate;
private final CenterReadPlatformService centerReadPlatformService;
private final GroupReadPlatformService groupReadPlatformService;
private final CollectionSheetGenerateCommandFromApiJsonDeserializer collectionSheetGenerateCommandFromApiJsonDeserializer;
@@ -100,8 +99,9 @@ public class CollectionSheetReadPlatformServiceImpl implements CollectionSheetRe
private final DatabaseSpecificSQLGenerator sqlGenerator;
@Autowired
public CollectionSheetReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource,
final CenterReadPlatformService centerReadPlatformService, final GroupReadPlatformService groupReadPlatformService,
public CollectionSheetReadPlatformServiceImpl(final PlatformSecurityContext context,
final NamedParameterJdbcTemplate namedParameterJdbcTemplate, final CenterReadPlatformService centerReadPlatformService,
final GroupReadPlatformService groupReadPlatformService,
final CollectionSheetGenerateCommandFromApiJsonDeserializer collectionSheetGenerateCommandFromApiJsonDeserializer,
final CalendarRepositoryWrapper calendarRepositoryWrapper,
final AttendanceDropdownReadPlatformService attendanceDropdownReadPlatformService,
@@ -111,7 +111,7 @@ public class CollectionSheetReadPlatformServiceImpl implements CollectionSheetRe
final CalendarInstanceRepository calendarInstanceRepository, DatabaseSpecificSQLGenerator sqlGenerator) {
this.context = context;
this.centerReadPlatformService = centerReadPlatformService;
this.namedParameterjdbcTemplate = new NamedParameterJdbcTemplate(dataSource);
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
this.collectionSheetGenerateCommandFromApiJsonDeserializer = collectionSheetGenerateCommandFromApiJsonDeserializer;
this.groupReadPlatformService = groupReadPlatformService;
this.calendarRepositoryWrapper = calendarRepositoryWrapper;
@@ -372,14 +372,14 @@ public class CollectionSheetReadPlatformServiceImpl implements CollectionSheetRe
.addValue("groupId", group.getId()).addValue("officeHierarchy", officeHierarchy)
.addValue("entityTypeId", entityType.getValue());
final Collection<JLGCollectionSheetFlatData> collectionSheetFlatDatas = this.namedParameterjdbcTemplate
final Collection<JLGCollectionSheetFlatData> collectionSheetFlatDatas = this.namedParameterJdbcTemplate
.query(mapper.collectionSheetSchema(false), namedParameters, mapper);
// loan data for collection sheet
JLGCollectionSheetData collectionSheetData = buildJLGCollectionSheet(transactionDate, collectionSheetFlatDatas);
// mandatory savings data for collection sheet
Collection<JLGGroupData> groupsWithSavingsData = this.namedParameterjdbcTemplate
Collection<JLGGroupData> groupsWithSavingsData = this.namedParameterJdbcTemplate
.query(mandatorySavingsExtractor.collectionSheetSchema(false), namedParameters, mandatorySavingsExtractor);
// merge savings data into loan data
@@ -477,14 +477,14 @@ public class CollectionSheetReadPlatformServiceImpl implements CollectionSheetRe
.addValue("centerId", center.getId()).addValue("officeHierarchy", officeHierarchy)
.addValue("entityTypeId", CalendarEntityType.CENTERS.getValue());
final Collection<JLGCollectionSheetFlatData> collectionSheetFlatDatas = this.namedParameterjdbcTemplate.query(sql.toString(),
final Collection<JLGCollectionSheetFlatData> collectionSheetFlatDatas = this.namedParameterJdbcTemplate.query(sql.toString(),
namedParameters, mapper);
// loan data for collection sheet
JLGCollectionSheetData collectionSheetData = buildJLGCollectionSheet(transactionDate, collectionSheetFlatDatas);
// mandatory savings data for collection sheet
Collection<JLGGroupData> groupsWithSavingsData = this.namedParameterjdbcTemplate
Collection<JLGGroupData> groupsWithSavingsData = this.namedParameterJdbcTemplate
.query(mandatorySavingsExtractor.collectionSheetSchema(true), namedParameters, mandatorySavingsExtractor);
// merge savings data into loan data
@@ -709,13 +709,13 @@ public class CollectionSheetReadPlatformServiceImpl implements CollectionSheetRe
((MapSqlParameterSource) namedParameters).addValue("staffId", staffId);
}
final Collection<IndividualCollectionSheetLoanFlatData> collectionSheetFlatDatas = this.namedParameterjdbcTemplate
final Collection<IndividualCollectionSheetLoanFlatData> collectionSheetFlatDatas = this.namedParameterJdbcTemplate
.query(mapper.sqlSchema(), namedParameters, mapper);
IndividualMandatorySavingsCollectionsheetExtractor mandatorySavingsExtractor = new IndividualMandatorySavingsCollectionsheetExtractor(
checkForOfficeId, checkForStaffId, sqlGenerator);
// mandatory savings data for collection sheet
Collection<IndividualClientData> clientData = this.namedParameterjdbcTemplate
Collection<IndividualClientData> clientData = this.namedParameterJdbcTemplate
.query(mandatorySavingsExtractor.collectionSheetSchema(), namedParameters, mandatorySavingsExtractor);
// merge savings data into loan data
@@ -25,7 +25,6 @@ import java.time.LocalDate;
import java.util.Date;
import java.util.List;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.portfolio.floatingrates.data.FloatingRateData;
import org.apache.fineract.portfolio.floatingrates.data.FloatingRatePeriodData;
import org.apache.fineract.portfolio.floatingrates.data.InterestRatePeriodData;
@@ -42,8 +41,8 @@ public class FloatingRatesReadPlatformServiceImpl implements FloatingRatesReadPl
private final JdbcTemplate jdbcTemplate;
@Autowired
public FloatingRatesReadPlatformServiceImpl(final RoutingDataSource dataSource) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
public FloatingRatesReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
@Override
@@ -21,7 +21,6 @@ package org.apache.fineract.portfolio.fund.service;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.portfolio.fund.data.FundData;
import org.apache.fineract.portfolio.fund.exception.FundNotFoundException;
@@ -39,9 +38,9 @@ public class FundReadPlatformServiceImpl implements FundReadPlatformService {
private final PlatformSecurityContext context;
@Autowired
public FundReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource) {
public FundReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
}
private static final class FundMapper implements RowMapper<FundData> {
@@ -44,7 +44,6 @@ import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidati
import org.apache.fineract.infrastructure.core.service.DateUtils;
import org.apache.fineract.infrastructure.core.service.Page;
import org.apache.fineract.infrastructure.core.service.PaginationHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.SearchParameters;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
@@ -101,7 +100,7 @@ public class CenterReadPlatformServiceImpl implements CenterReadPlatformService
private static final Set<String> SUPPORTED_ORDER_BY_VALUES = new HashSet<>(Arrays.asList("id", "name", "officeId", "officeName"));
@Autowired
public CenterReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource,
public CenterReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate,
final ClientReadPlatformService clientReadPlatformService, final OfficeReadPlatformService officeReadPlatformService,
final StaffReadPlatformService staffReadPlatformService, final CodeValueReadPlatformService codeValueReadPlatformService,
final PaginationParametersDataValidator paginationParametersDataValidator,
@@ -109,7 +108,7 @@ public class CenterReadPlatformServiceImpl implements CenterReadPlatformService
final ColumnValidator columnValidator, DatabaseSpecificSQLGenerator sqlGenerator, PaginationHelper paginationHelper) {
this.context = context;
this.clientReadPlatformService = clientReadPlatformService;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.officeReadPlatformService = officeReadPlatformService;
this.staffReadPlatformService = staffReadPlatformService;
this.codeValueReadPlatformService = codeValueReadPlatformService;
@@ -22,7 +22,6 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.portfolio.group.data.GroupLevelData;
import org.springframework.beans.factory.annotation.Autowired;
@@ -37,9 +36,9 @@ public class GroupLevelReadPlatformServiceImpl implements GroupLevelReadPlatform
private final JdbcTemplate jdbcTemplate;
@Autowired
public GroupLevelReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource) {
public GroupLevelReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
}
@Override
@@ -33,7 +33,6 @@ import org.apache.fineract.infrastructure.core.data.PaginationParametersDataVali
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.Page;
import org.apache.fineract.infrastructure.core.service.PaginationHelper;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.SearchParameters;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
@@ -76,13 +75,13 @@ public class GroupReadPlatformServiceImpl implements GroupReadPlatformService {
private static final Set<String> supportedOrderByValues = new HashSet<>(Arrays.asList("id", "name", "officeId", "officeName"));
@Autowired
public GroupReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource,
public GroupReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate,
final CenterReadPlatformService centerReadPlatformService, final OfficeReadPlatformService officeReadPlatformService,
final StaffReadPlatformService staffReadPlatformService, final CodeValueReadPlatformService codeValueReadPlatformService,
final PaginationParametersDataValidator paginationParametersDataValidator, final ColumnValidator columnValidator,
DatabaseSpecificSQLGenerator sqlGenerator, PaginationHelper paginationHelper) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.centerReadPlatformService = centerReadPlatformService;
this.officeReadPlatformService = officeReadPlatformService;
this.staffReadPlatformService = staffReadPlatformService;
@@ -23,7 +23,6 @@ import java.sql.SQLException;
import java.util.Collection;
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.portfolio.group.data.GroupRoleData;
import org.apache.fineract.portfolio.group.exception.GroupRoleNotFoundException;
@@ -40,9 +39,9 @@ public class GroupRolesReadPlatformServiceImpl implements GroupRolesReadPlatform
private final PlatformSecurityContext context;
@Autowired
public GroupRolesReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource) {
public GroupRolesReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
}
@Override
@@ -29,7 +29,6 @@ import org.apache.fineract.infrastructure.codes.data.CodeValueData;
import org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformService;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.organisation.monetary.data.CurrencyData;
@@ -62,12 +61,12 @@ public class InterestRateChartReadPlatformServiceImpl implements InterestRateCha
private final DatabaseSpecificSQLGenerator sqlGenerator;
@Autowired
public InterestRateChartReadPlatformServiceImpl(PlatformSecurityContext context, final RoutingDataSource dataSource,
public InterestRateChartReadPlatformServiceImpl(PlatformSecurityContext context, final JdbcTemplate jdbcTemplate,
InterestRateChartDropdownReadPlatformService chartDropdownReadPlatformService,
final InterestIncentiveDropdownReadPlatformService interestIncentiveDropdownReadPlatformService,
final CodeValueReadPlatformService codeValueReadPlatformService, DatabaseSpecificSQLGenerator sqlGenerator) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.chartDropdownReadPlatformService = chartDropdownReadPlatformService;
this.interestIncentiveDropdownReadPlatformService = interestIncentiveDropdownReadPlatformService;
this.codeValueReadPlatformService = codeValueReadPlatformService;
@@ -28,7 +28,6 @@ import org.apache.fineract.infrastructure.codes.data.CodeValueData;
import org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformService;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.organisation.monetary.data.CurrencyData;
@@ -57,12 +56,12 @@ public class InterestRateChartSlabReadPlatformServiceImpl implements InterestRat
private final DatabaseSpecificSQLGenerator sqlGenerator;
@Autowired
public InterestRateChartSlabReadPlatformServiceImpl(PlatformSecurityContext context, final RoutingDataSource dataSource,
public InterestRateChartSlabReadPlatformServiceImpl(PlatformSecurityContext context, final JdbcTemplate jdbcTemplate,
InterestRateChartDropdownReadPlatformService chartDropdownReadPlatformService,
final InterestIncentiveDropdownReadPlatformService interestIncentiveDropdownReadPlatformService,
final CodeValueReadPlatformService codeValueReadPlatformService, DatabaseSpecificSQLGenerator sqlGenerator) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.chartDropdownReadPlatformService = chartDropdownReadPlatformService;
this.interestIncentiveDropdownReadPlatformService = interestIncentiveDropdownReadPlatformService;
this.codeValueReadPlatformService = codeValueReadPlatformService;
@@ -29,7 +29,6 @@ import java.util.List;
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.organisation.staff.data.StaffData;
import org.apache.fineract.organisation.staff.service.StaffReadPlatformService;
import org.apache.fineract.portfolio.account.data.PortfolioAccountData;
@@ -60,9 +59,9 @@ public class GuarantorReadPlatformServiceImpl implements GuarantorReadPlatformSe
private final LoanRepositoryWrapper loanRepositoryWrapper;
@Autowired
public GuarantorReadPlatformServiceImpl(final RoutingDataSource dataSource, final ClientReadPlatformService clientReadPlatformService,
public GuarantorReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate, final ClientReadPlatformService clientReadPlatformService,
final StaffReadPlatformService staffReadPlatformService, final LoanRepositoryWrapper loanRepositoryWrapper) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.clientReadPlatformService = clientReadPlatformService;
this.staffReadPlatformService = staffReadPlatformService;
this.loanRepositoryWrapper = loanRepositoryWrapper;
@@ -27,7 +27,6 @@ import java.util.ArrayList;
import java.util.Collection;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.organisation.monetary.data.CurrencyData;
import org.apache.fineract.organisation.monetary.domain.MonetaryCurrency;
@@ -53,9 +52,9 @@ public class LoanScheduleHistoryReadPlatformServiceImpl implements LoanScheduleH
private final PlatformSecurityContext context;
@Autowired
public LoanScheduleHistoryReadPlatformServiceImpl(final RoutingDataSource dataSource, final PlatformSecurityContext context) {
public LoanScheduleHistoryReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate, final PlatformSecurityContext context) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
}
@SuppressWarnings("deprecation")
@@ -29,7 +29,6 @@ import java.util.List;
import org.apache.fineract.infrastructure.codes.data.CodeValueData;
import org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformService;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.portfolio.loanaccount.data.LoanTermVariationsData;
import org.apache.fineract.portfolio.loanaccount.domain.LoanRepositoryWrapper;
import org.apache.fineract.portfolio.loanaccount.rescheduleloan.RescheduleLoansApiConstants;
@@ -53,9 +52,9 @@ public class LoanRescheduleRequestReadPlatformServiceImpl implements LoanResched
private final CodeValueReadPlatformService codeValueReadPlatformService;
@Autowired
public LoanRescheduleRequestReadPlatformServiceImpl(final RoutingDataSource dataSource, LoanRepositoryWrapper loanRepositoryWrapper,
public LoanRescheduleRequestReadPlatformServiceImpl(final JdbcTemplate jdbcTemplate, LoanRepositoryWrapper loanRepositoryWrapper,
final CodeValueReadPlatformService codeValueReadPlatformService) {
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.loanRepositoryWrapper = loanRepositoryWrapper;
this.codeValueReadPlatformService = codeValueReadPlatformService;
}
@@ -23,7 +23,6 @@ import java.sql.SQLException;
import java.util.Collection;
import java.util.List;
import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.organisation.staff.data.StaffAccountSummaryCollectionData;
import org.apache.fineract.portfolio.accountdetails.data.LoanAccountSummaryData;
@@ -43,10 +42,10 @@ public class BulkLoansReadPlatformServiceImpl implements BulkLoansReadPlatformSe
private final AccountDetailsReadPlatformService accountDetailsReadPlatformService;
@Autowired
public BulkLoansReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource,
public BulkLoansReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate,
final AccountDetailsReadPlatformService accountDetailsReadPlatformService) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.accountDetailsReadPlatformService = accountDetailsReadPlatformService;
}
@@ -25,7 +25,6 @@ import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.apache.fineract.infrastructure.core.service.RoutingDataSource;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.portfolio.accountdetails.data.LoanAccountSummaryData;
import org.apache.fineract.portfolio.accountdetails.service.AccountDetailsReadPlatformService;
@@ -46,10 +45,10 @@ public class GLIMAccountInfoReadPlatformServiceImpl implements GLIMAccountInfoRe
private final AccountDetailsReadPlatformService accountDetailsReadPlatforService;
@Autowired
public GLIMAccountInfoReadPlatformServiceImpl(final PlatformSecurityContext context, final RoutingDataSource dataSource,
public GLIMAccountInfoReadPlatformServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate,
final AccountDetailsReadPlatformService accountDetailsReadPlatforService) {
this.context = context;
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.jdbcTemplate = jdbcTemplate;
this.accountDetailsReadPlatforService = accountDetailsReadPlatforService;
}

Some files were not shown because too many files have changed in this diff Show More