fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [fineract] vorburger commented on a change in pull request #737: FINERACT-38
Date Fri, 17 Apr 2020 19:49:31 GMT
vorburger commented on a change in pull request #737: FINERACT-38
URL: https://github.com/apache/fineract/pull/737#discussion_r410434705
 
 

 ##########
 File path: fineract-provider/src/main/java/org/apache/fineract/organisation/office/service/OfficeReadPlatformServiceImpl.java
 ##########
 @@ -266,4 +266,20 @@ public OfficeTransactionData retrieveNewOfficeTransactionDetails() {
     public PlatformSecurityContext getContext() {
         return this.context;
     }
+
+    @Override
+    public Collection<Long> officeByHierarchy(Long officeId) {
+        StringBuilder sqlBuilder = new StringBuilder();
+        sqlBuilder.append("SELECT ounder.id FROM m_office mo ");
+        sqlBuilder.append(" JOIN m_office ounder ON ounder.hierarchy LIKE CONCAT(mo.hierarchy,
'%') ");
+        sqlBuilder.append(" AND ounder.hierarchy like CONCAT('.', '%') where mo.id = ? ");
+
+
+        try {
+            return this.jdbcTemplate.queryForList(sqlBuilder.toString(), Long.class,
+                    new Object[] { officeId});
+        } catch (final EmptyResultDataAccessException e) {
+           return null;
+        }
 
 Review comment:
   This strikes me as curious - is this done like this elsewhere in existing code?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message