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:
[email protected]
With regards,
Apache Git Services