コード例 #1
0
    @Override
    public RecurringDepositProductData mapRow(
        final ResultSet rs, @SuppressWarnings("unused") final int rowNum) throws SQLException {

      final DepositProductData depositProductData = super.mapRow(rs);

      final boolean interestFreePeriodApplicable = rs.getBoolean("interestFreePeriodApplicable");
      final Integer interestFreeFromPeriod = JdbcSupport.getInteger(rs, "interestFreeFromPeriod");
      final Integer interestFreeToPeriod = JdbcSupport.getInteger(rs, "interestFreeToPeriod");
      final Integer periodFrequencyTypeId =
          JdbcSupport.getInteger(rs, "interestFreePeriodFrequencyId");
      final EnumOptionData interestFreePeriodFrequencyType =
          (periodFrequencyTypeId == null)
              ? null
              : InterestRateChartEnumerations.periodType(periodFrequencyTypeId);
      final boolean preClosurePenalApplicable = rs.getBoolean("preClosurePenalApplicable");
      final BigDecimal preClosurePenalInterest =
          JdbcSupport.getBigDecimalDefaultToNullIfZero(rs, "preClosurePenalInterest");
      final Integer preClosurePenalInterestOnTypeId =
          JdbcSupport.getInteger(rs, "preClosurePenalInterestOnId");
      final EnumOptionData preClosurePenalInterestOnType =
          (preClosurePenalInterestOnTypeId == null)
              ? null
              : SavingsEnumerations.preClosurePenaltyInterestOnType(
                  preClosurePenalInterestOnTypeId);
      final Integer recurringDepositTypeId = JdbcSupport.getInteger(rs, "recurringDepositTypeId");
      final EnumOptionData recurringDepositType =
          (recurringDepositTypeId == null)
              ? null
              : SavingsEnumerations.recurringDepositType(recurringDepositTypeId);
      final Integer recurringDepositFrequency =
          JdbcSupport.getInteger(rs, "recurringDepositFrequency");
      final Integer recurringDepositFrequencyTypeId =
          JdbcSupport.getInteger(rs, "recurringDepositFrequencyTypeId");
      final BigDecimal minDepositAmount =
          JdbcSupport.getBigDecimalDefaultToNullIfZero(rs, "minDepositAmount");
      final BigDecimal depositAmount =
          JdbcSupport.getBigDecimalDefaultToNullIfZero(rs, "depositAmount");
      final BigDecimal maxDepositAmount =
          JdbcSupport.getBigDecimalDefaultToNullIfZero(rs, "maxDepositAmount");
      final EnumOptionData recurringDepositFrequencyType =
          (recurringDepositFrequencyTypeId == null)
              ? null
              : SavingsEnumerations.recurringDepositFrequencyType(recurringDepositFrequencyTypeId);

      final Integer minDepositTerm = JdbcSupport.getInteger(rs, "minDepositTerm");
      final Integer maxDepositTerm = JdbcSupport.getInteger(rs, "maxDepositTerm");
      final Integer minDepositTermTypeId = JdbcSupport.getInteger(rs, "minDepositTermTypeId");
      final EnumOptionData minDepositTermType =
          (minDepositTermTypeId == null)
              ? null
              : SavingsEnumerations.depositTermFrequencyType(minDepositTermTypeId);
      final Integer maxDepositTermTypeId = JdbcSupport.getInteger(rs, "maxDepositTermTypeId");
      final EnumOptionData maxDepositTermType =
          (maxDepositTermTypeId == null)
              ? null
              : SavingsEnumerations.depositTermFrequencyType(maxDepositTermTypeId);
      final Integer inMultiplesOfDepositTerm =
          JdbcSupport.getInteger(rs, "inMultiplesOfDepositTerm");
      final Integer inMultiplesOfDepositTermTypeId =
          JdbcSupport.getInteger(rs, "inMultiplesOfDepositTermTypeId");
      final EnumOptionData inMultiplesOfDepositTermType =
          (inMultiplesOfDepositTermTypeId == null)
              ? null
              : SavingsEnumerations.depositTermFrequencyType(inMultiplesOfDepositTermTypeId);

      return RecurringDepositProductData.instance(
          depositProductData,
          interestFreePeriodApplicable,
          interestFreeFromPeriod,
          interestFreeToPeriod,
          interestFreePeriodFrequencyType,
          preClosurePenalApplicable,
          preClosurePenalInterest,
          preClosurePenalInterestOnType,
          minDepositTerm,
          maxDepositTerm,
          minDepositTermType,
          maxDepositTermType,
          inMultiplesOfDepositTerm,
          inMultiplesOfDepositTermType,
          recurringDepositType,
          recurringDepositFrequency,
          recurringDepositFrequencyType,
          minDepositAmount,
          depositAmount,
          maxDepositAmount);
    }
    @Override
    public SavingsAccountSummaryData mapRow(
        final ResultSet rs, @SuppressWarnings("unused") final int rowNum) throws SQLException {

      final Long id = JdbcSupport.getLong(rs, "id");
      final String accountNo = rs.getString("accountNo");
      final String externalId = rs.getString("externalId");
      final Long productId = JdbcSupport.getLong(rs, "productId");
      final String productName = rs.getString("productName");
      final Integer statusId = JdbcSupport.getInteger(rs, "statusEnum");
      final BigDecimal accountBalance =
          JdbcSupport.getBigDecimalDefaultToNullIfZero(rs, "accountBalance");
      final SavingsAccountStatusEnumData status = SavingsEnumerations.status(statusId);
      final Integer accountType = JdbcSupport.getInteger(rs, "accountType");
      final EnumOptionData accountTypeData = AccountEnumerations.loanType(accountType);

      final String currencyCode = rs.getString("currencyCode");
      final String currencyName = rs.getString("currencyName");
      final String currencyNameCode = rs.getString("currencyNameCode");
      final String currencyDisplaySymbol = rs.getString("currencyDisplaySymbol");
      final Integer currencyDigits = JdbcSupport.getInteger(rs, "currencyDigits");
      final Integer inMultiplesOf = JdbcSupport.getInteger(rs, "inMultiplesOf");
      final CurrencyData currency =
          new CurrencyData(
              currencyCode,
              currencyName,
              currencyDigits,
              inMultiplesOf,
              currencyDisplaySymbol,
              currencyNameCode);

      final LocalDate submittedOnDate = JdbcSupport.getLocalDate(rs, "submittedOnDate");
      final String submittedByUsername = rs.getString("submittedByUsername");
      final String submittedByFirstname = rs.getString("submittedByFirstname");
      final String submittedByLastname = rs.getString("submittedByLastname");

      final LocalDate rejectedOnDate = JdbcSupport.getLocalDate(rs, "rejectedOnDate");
      final String rejectedByUsername = rs.getString("rejectedByUsername");
      final String rejectedByFirstname = rs.getString("rejectedByFirstname");
      final String rejectedByLastname = rs.getString("rejectedByLastname");

      final LocalDate withdrawnOnDate = JdbcSupport.getLocalDate(rs, "withdrawnOnDate");
      final String withdrawnByUsername = rs.getString("withdrawnByUsername");
      final String withdrawnByFirstname = rs.getString("withdrawnByFirstname");
      final String withdrawnByLastname = rs.getString("withdrawnByLastname");

      final LocalDate approvedOnDate = JdbcSupport.getLocalDate(rs, "approvedOnDate");
      final String approvedByUsername = rs.getString("approvedByUsername");
      final String approvedByFirstname = rs.getString("approvedByFirstname");
      final String approvedByLastname = rs.getString("approvedByLastname");

      final LocalDate activatedOnDate = JdbcSupport.getLocalDate(rs, "activatedOnDate");
      final String activatedByUsername = rs.getString("activatedByUsername");
      final String activatedByFirstname = rs.getString("activatedByFirstname");
      final String activatedByLastname = rs.getString("activatedByLastname");

      final LocalDate closedOnDate = JdbcSupport.getLocalDate(rs, "closedOnDate");
      final String closedByUsername = rs.getString("closedByUsername");
      final String closedByFirstname = rs.getString("closedByFirstname");
      final String closedByLastname = rs.getString("closedByLastname");

      final SavingsAccountApplicationTimelineData timeline =
          new SavingsAccountApplicationTimelineData(
              submittedOnDate,
              submittedByUsername,
              submittedByFirstname,
              submittedByLastname,
              rejectedOnDate,
              rejectedByUsername,
              rejectedByFirstname,
              rejectedByLastname,
              withdrawnOnDate,
              withdrawnByUsername,
              withdrawnByFirstname,
              withdrawnByLastname,
              approvedOnDate,
              approvedByUsername,
              approvedByFirstname,
              approvedByLastname,
              activatedOnDate,
              activatedByUsername,
              activatedByFirstname,
              activatedByLastname,
              closedOnDate,
              closedByUsername,
              closedByFirstname,
              closedByLastname);

      return new SavingsAccountSummaryData(
          id,
          accountNo,
          externalId,
          productId,
          productName,
          status,
          currency,
          accountBalance,
          accountTypeData,
          timeline);
    }