fineract-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FINERACT-54) Add ability to delete code values by setting a flag (is_active) to 0
Date Wed, 03 Aug 2016 11:59:21 GMT

    [ https://issues.apache.org/jira/browse/FINERACT-54?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15405791#comment-15405791
] 

ASF GitHub Bot commented on FINERACT-54:
----------------------------------------

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. 


> Add ability to delete code values by setting a flag (is_active) to 0
> --------------------------------------------------------------------
>
>                 Key: FINERACT-54
>                 URL: https://issues.apache.org/jira/browse/FINERACT-54
>             Project: Apache Fineract
>          Issue Type: Improvement
>            Reporter: Emmanuel Nnaa
>            Assignee: Markus Geiss
>            Priority: Minor
>
> Delete a code value by setting the "is_active" property to 0, thus avoiding "DataIntegrityViolationException".



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message