Package org.mifosplatform.infrastructure.codes.exception

Examples of org.mifosplatform.infrastructure.codes.exception.CodeValueNotFoundException


        this.repository = repository;
    }

    public CodeValue findOneWithNotFoundDetection(final Long id) {
        final CodeValue codeValue = this.repository.findOne(id);
        if (codeValue == null) { throw new CodeValueNotFoundException(id); }
        return codeValue;
    }
View Full Code Here


        return codeValue;
    }

    public CodeValue findOneByCodeNameAndIdWithNotFoundDetection(final String codeName, final Long id) {
        final CodeValue codeValue = this.repository.findByCodeNameAndId(codeName, id);
        if (codeValue == null) { throw new CodeValueNotFoundException(codeName, id); }
        return codeValue;
    }
View Full Code Here

            final List<AccountingTagRule> accountingTagRules) {
        for (final String creditOrDebitTag : creditOrDebitTagArray) {
            if (creditOrDebitTag != null && StringUtils.isNotBlank(creditOrDebitTag)) {
                final Long creditOrDebitTagIdLongValue = Long.valueOf(creditOrDebitTag);
                final CodeValue creditOrDebitAccount = this.codeValueRepository.findOne(creditOrDebitTagIdLongValue);
                if (creditOrDebitAccount == null) { throw new CodeValueNotFoundException(creditOrDebitTagIdLongValue); }
                final AccountingTagRule accountingTagRule = AccountingTagRule.create(creditOrDebitAccount, transactionType.getValue());
                accountingTagRules.add(accountingTagRule);
            }
        }
        return accountingTagRules;
View Full Code Here

          + "where cv.id = ? order by position";

      return this.jdbcTemplate.queryForObject(sql, rm,
          new Object[] { codeValueId });
    } catch (final EmptyResultDataAccessException e) {
      throw new CodeValueNotFoundException(codeValueId);
    }


    }
View Full Code Here

            final Map<String, Object> changes = clientIdentifierForUpdate.update(command);

            if (changes.containsKey("documentTypeId")) {
                documentType = this.codeValueRepository.findOneWithNotFoundDetection(documentTypeId);
                if (documentType == null) { throw new CodeValueNotFoundException(documentTypeId); }

                documentTypeId = documentType.getId();
                documentTypeLabel = documentType.label();
                clientIdentifierForUpdate.update(documentType);
            }
View Full Code Here

TOP

Related Classes of org.mifosplatform.infrastructure.codes.exception.CodeValueNotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.