@Override public AuditData mapRow(final ResultSet rs, @SuppressWarnings("unused") final int rowNum) throws SQLException { final Long id = rs.getLong("id"); final String actionName = rs.getString("actionName"); final String entityName = rs.getString("entityName"); final Long resourceId = JdbcSupport.getLong(rs, "resourceId"); final Long clientId = JdbcSupport.getLong(rs, "clientId"); final Long loanId = JdbcSupport.getLong(rs, "loanId"); final Long subresourceId = JdbcSupport.getLong(rs, "subresourceId"); final String maker = rs.getString("maker"); final DateTime madeOnDate = JdbcSupport.getDateTime(rs, "madeOnDate"); final String checker = rs.getString("checker"); final DateTime checkedOnDate = JdbcSupport.getDateTime(rs, "checkedOnDate"); final String processingResult = rs.getString("processingResult"); final String resourceGetUrl = rs.getString("resourceGetUrl"); String commandAsJson; // commandAsJson might not be on the select list of columns try { commandAsJson = rs.getString("commandAsJson"); } catch (final SQLException e) { commandAsJson = null; } final String officeName = rs.getString("officeName"); final String groupLevelName = rs.getString("groupLevelName"); final String groupName = rs.getString("groupName"); final String clientName = rs.getString("clientName"); final String loanAccountNo = rs.getString("loanAccountNo"); final String savingsAccountNo = rs.getString("savingsAccountNo"); return new AuditData( id, actionName, entityName, resourceId, subresourceId, maker, madeOnDate, checker, checkedOnDate, processingResult, commandAsJson, officeName, groupLevelName, groupName, clientName, loanAccountNo, savingsAccountNo, clientId, loanId, resourceGetUrl); }
@Override public ProcessingResultLookup mapRow( final ResultSet rs, @SuppressWarnings("unused") final int rowNum) throws SQLException { final Long id = JdbcSupport.getLong(rs, "id"); final String processingResult = rs.getString("processingResult"); return new ProcessingResultLookup(id, processingResult); }
@Override public JournalEntryData mapRow(final ResultSet rs, @SuppressWarnings("unused") final int rowNum) throws SQLException { final Long id = rs.getLong("id"); final Long officeId = rs.getLong("officeId"); final String officeName = rs.getString("officeName"); final String glCode = rs.getString("glAccountCode"); final String glAccountName = rs.getString("glAccountName"); final Long glAccountId = rs.getLong("glAccountId"); final int accountTypeId = JdbcSupport.getInteger(rs, "classification"); final EnumOptionData accountType = AccountingEnumerations.gLAccountType(accountTypeId); final LocalDate transactionDate = JdbcSupport.getLocalDate(rs, "transactionDate"); final Boolean manualEntry = rs.getBoolean("manualEntry"); final BigDecimal amount = rs.getBigDecimal("amount"); final int entryTypeId = JdbcSupport.getInteger(rs, "entryType"); final EnumOptionData entryType = AccountingEnumerations.journalEntryType(entryTypeId); final String transactionId = rs.getString("transactionId"); final Integer entityTypeId = JdbcSupport.getInteger(rs, "entityType"); EnumOptionData entityType = null; if (entityTypeId != null) { entityType = AccountingEnumerations.portfolioProductType(entityTypeId); } final Long entityId = JdbcSupport.getLong(rs, "entityId"); final Long createdByUserId = rs.getLong("createdByUserId"); final LocalDate createdDate = JdbcSupport.getLocalDate(rs, "createdDate"); final String createdByUserName = rs.getString("createdByUserName"); final String comments = rs.getString("comments"); final Boolean reversed = rs.getBoolean("reversed"); final String referenceNumber = rs.getString("referenceNumber"); BigDecimal officeRunningBalance = null; BigDecimal organizationRunningBalance = null; Boolean runningBalanceComputed = null; 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); if (associationParametersData.isRunningBalanceRequired()) { officeRunningBalance = rs.getBigDecimal("officeRunningBalance"); organizationRunningBalance = rs.getBigDecimal("organizationRunningBalance"); runningBalanceComputed = rs.getBoolean("runningBalanceComputed"); } TransactionDetailData transactionDetailData = null; if (associationParametersData.isTransactionDetailsRequired()) { PaymentDetailData paymentDetailData = null; final Long paymentTypeId = JdbcSupport.getLong(rs, "paymentTypeId"); if (paymentTypeId != null) { final String typeName = rs.getString("paymentTypeName"); final PaymentTypeData paymentType = PaymentTypeData.instance(paymentTypeId, typeName); final String accountNumber = rs.getString("accountNumber"); final String checkNumber = rs.getString("checkNumber"); final String routingCode = rs.getString("routingCode"); final String receiptNumber = rs.getString("receiptNumber"); final String bankNumber = rs.getString("bankNumber"); paymentDetailData = new PaymentDetailData( id, paymentType, accountNumber, checkNumber, routingCode, receiptNumber, bankNumber); } NoteData noteData = null; final Long noteId = JdbcSupport.getLong(rs, "noteId"); if (noteId != null) { final String note = rs.getString("transactionNote"); noteData = new NoteData( noteId, null, null, null, null, null, null, null, note, null, null, null, null, null, null); } Long transaction = null; if (entityType != null) { transaction = Long.parseLong(transactionId.substring(1).trim()); } TransactionTypeEnumData transactionTypeEnumData = null; if (PortfolioAccountType.fromInt(entityTypeId).isLoanAccount()) { final LoanTransactionEnumData loanTransactionType = LoanEnumerations.transactionType(JdbcSupport.getInteger(rs, "loanTransactionType")); transactionTypeEnumData = new TransactionTypeEnumData( loanTransactionType.id(), loanTransactionType.getCode(), loanTransactionType.getValue()); } else if (PortfolioAccountType.fromInt(entityTypeId).isSavingsAccount()) { final SavingsAccountTransactionEnumData savingsTransactionType = SavingsEnumerations.transactionType( JdbcSupport.getInteger(rs, "savingsTransactionType")); transactionTypeEnumData = new TransactionTypeEnumData( savingsTransactionType.getId(), savingsTransactionType.getCode(), savingsTransactionType.getValue()); } transactionDetailData = new TransactionDetailData( transaction, paymentDetailData, noteData, transactionTypeEnumData); } return new JournalEntryData( id, officeId, officeName, glAccountName, glAccountId, glCode, accountType, transactionDate, entryType, amount, transactionId, manualEntry, entityType, entityId, createdByUserId, createdDate, createdByUserName, comments, reversed, referenceNumber, officeRunningBalance, organizationRunningBalance, runningBalanceComputed, transactionDetailData, currency); }