fineract-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nazeer1100126 <...@git.apache.org>
Subject [GitHub] incubator-fineract pull request #192: commit FINERACT-54 (Add ability to del...
Date Wed, 03 Aug 2016 11:58:46 GMT
Github user nazeer1100126 commented on a diff in the pull request:

    https://github.com/apache/incubator-fineract/pull/192#discussion_r73326113
  
    --- Diff: fineract-provider/src/main/java/org/apache/fineract/infrastructure/codes/service/CodeValueReadPlatformServiceImpl.java
---
    @@ -96,12 +97,27 @@ public CodeValueData retrieveCodeValue(final Long codeValueId) {
                 this.context.authenticatedUser();
     
                 final CodeValueDataMapper rm = new CodeValueDataMapper();
    -            final String sql = "select " + rm.schema() + "where cv.id = ? order by position";
    +            final String sql = "select " + rm.schema() + " where cv.id = ? and cv.is_active
= 1 order by position";
     
                 return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { codeValueId
});
             } catch (final EmptyResultDataAccessException e) {
                 throw new CodeValueNotFoundException(codeValueId);
             }
     
         }
    +
    +    @Override
    +    public Collection<CodeValueData> retrieveAllActiveCodeValues(Long codeId) {
    +        final Collection<CodeValueData> codeValues = this.retrieveAllCodeValues(codeId);
    --- End diff --
    
    Suggestion: get Active Code values from DB instead of getting all and looping them to
find active ones. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message