You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by "adamsaghy (via GitHub)" <gi...@apache.org> on 2023/06/20 14:40:28 UTC

[GitHub] [fineract] adamsaghy commented on a diff in pull request #3226: FINERACT-1910 Support Pagination, sorting and filtering for Datatable

adamsaghy commented on code in PR #3226:
URL: https://github.com/apache/fineract/pull/3226#discussion_r1235373547


##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/ReadWriteNonCoreDataServiceImpl.java:
##########
@@ -214,6 +214,185 @@ public List<JsonObject> queryDataTable(String datatable, final String columnFilt
 
         return results;
     }
+    @Override
+    public Page<JsonObject> queryDataTableSearch(PagedRequest<DatatableSearchRequest> searchRequest) {
+
+        Objects.requireNonNull(searchRequest, "Search Request Should not be Empty");
+        Optional<DatatableSearchRequest> request = searchRequest.getRequest();
+        List<String> resultColumns = request.map(DatatableSearchRequest::getResultColumns).orElse(Collections.emptyList());
+        List<ColumnFilter> columnFilters = request.map(DatatableSearchRequest::getColumnFilters).orElse(Collections.emptyList());
+        String datatable = request.map(DatatableSearchRequest::getDatatable).orElse(null);
+        Pageable pageable = searchRequest.toPageable();
+
+        this.context.authenticatedUser().validateHasDatatableReadPermission(datatable);
+
+        List<JsonObject> results = new ArrayList<>();
+        AtomicInteger totalElements = new AtomicInteger(0);

Review Comment:
   Why `AtomicInteger`?



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org