Package org.mifosplatform.infrastructure.codes.exception

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


            this.fromApiJsonDeserializer.validateForCreate(command.json());

            final Long codeId = command.entityId();
            final Code code = this.codeRepository.findOne(codeId);
            if (code == null) {
                throw new CodeNotFoundException(codeId);
            }
            final CodeValue codeValue = CodeValue.fromJson(code, command);
            this.codeValueRepository.save(codeValue);

            return new CommandProcessingResultBuilder() //
View Full Code Here


        try {
            this.context.authenticatedUser();

            final Code code = this.codeRepository.findOne(codeId);
            if (code == null) { throw new CodeNotFoundException(codeId); }

            final CodeValue codeValueToDelete = this.codeValueRepositoryWrapper.findOneWithNotFoundDetection(codeValueId);

            final boolean removed = code.remove(codeValueToDelete);
            if (removed) {
View Full Code Here

        return new CommandProcessingResultBuilder().withEntityId(codeId).build();
    }

    private Code retrieveCodeBy(final Long codeId) {
        final Code code = this.codeRepository.findOne(codeId);
        if (code == null) { throw new CodeNotFoundException(codeId.toString()); }
        return code;
    }
View Full Code Here

            final CodeMapper rm = new CodeMapper();
            final String sql = "select " + rm.schema() + " where c.id = ?";

            return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { codeId });
        } catch (final EmptyResultDataAccessException e) {
            throw new CodeNotFoundException(codeId);
        }
    }
View Full Code Here

            final CodeMapper rm = new CodeMapper();
            final String sql = "select " + rm.schema() + " where c.code_name = ?";

            return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { codeName });
        } catch (final EmptyResultDataAccessException e) {
            throw new CodeNotFoundException(codeName);
        }
    }
View Full Code Here

TOP

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

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.