diff --git a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GradStudentService.java b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GradStudentService.java index 955d5063..39d277de 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GradStudentService.java +++ b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GradStudentService.java @@ -398,6 +398,18 @@ public List getStudentIDsByStatusCode(List studentIDs, String status if (StringUtils.isBlank(statusCode) || studentIDs.isEmpty()) { return new ArrayList<>(); } - return graduationStatusRepository.filterGivenStudentsByStatusCode(studentIDs, statusCode); + List results = new ArrayList<>(); + int pageSize = 1000; + int pageNum = studentIDs.size() / pageSize + 1; + for (int i = 0; i < pageNum; i++) { + int startIndex = i * pageSize; + int endIndex = Math.min(startIndex + pageSize, studentIDs.size()); + List inputIDs = studentIDs.subList(startIndex, endIndex); + List responseIDs = graduationStatusRepository.filterGivenStudentsByStatusCode(inputIDs, statusCode); + if (responseIDs != null && !responseIDs.isEmpty()) { + results.addAll(responseIDs); + } + } + return results; } }