From bde033b83a73d24799d4269e729d3b5f4e90b81a Mon Sep 17 00:00:00 2001 From: himeshr Date: Tue, 28 May 2024 14:22:51 +0530 Subject: [PATCH] avniproject/avni-webapp#1203 | Fix clash of method ReferenceDataRepository.findAllByUuidIn() across repositories --- .../java/org/avni/server/dao/AddressLevelTypeRepository.java | 2 -- .../src/main/java/org/avni/server/dao/IndividualRepository.java | 2 +- .../src/main/java/org/avni/server/web/IndividualController.java | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/avni-server-api/src/main/java/org/avni/server/dao/AddressLevelTypeRepository.java b/avni-server-api/src/main/java/org/avni/server/dao/AddressLevelTypeRepository.java index 486c2cbe8..35757fde1 100644 --- a/avni-server-api/src/main/java/org/avni/server/dao/AddressLevelTypeRepository.java +++ b/avni-server-api/src/main/java/org/avni/server/dao/AddressLevelTypeRepository.java @@ -23,8 +23,6 @@ public interface AddressLevelTypeRepository extends ReferenceDataRepository findAllByIdIn(Collection id); - List findAllByUuidIn(Collection UUIDs); - @Query("select a.name from AddressLevelType a where a.isVoided = false") List getAllNames(); diff --git a/avni-server-api/src/main/java/org/avni/server/dao/IndividualRepository.java b/avni-server-api/src/main/java/org/avni/server/dao/IndividualRepository.java index ff2c4166e..c1b9c6964 100644 --- a/avni-server-api/src/main/java/org/avni/server/dao/IndividualRepository.java +++ b/avni-server-api/src/main/java/org/avni/server/dao/IndividualRepository.java @@ -175,7 +175,7 @@ default Page findSubjects(IndividualSearchParams individualSearchPar List findAllByAddressLevelAndSubjectTypeAndIsVoidedFalse(AddressLevel addressLevel, SubjectType subjectType); List findAllByAddressLevelAndSubjectType(AddressLevel addressLevel, SubjectType subjectType); - List findAllByUuidIn(List uuids); + List findAllIndividualWebProjectionByUuidIn(List uuids); @Modifying(clearAutomatically = true) @Query(value = "update individual i set " + diff --git a/avni-server-api/src/main/java/org/avni/server/web/IndividualController.java b/avni-server-api/src/main/java/org/avni/server/web/IndividualController.java index 29ccecdf3..dad262181 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/IndividualController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/IndividualController.java @@ -210,7 +210,7 @@ public IndividualWebProjection getOneForWeb(@PathVariable String uuid) { @PreAuthorize(value = "hasAnyAuthority('user')") @ResponseBody public List getByUUIDs(@RequestParam(value = "uuids") List uuids) { - List projections = individualRepository.findAllByUuidIn(uuids); + List projections = individualRepository.findAllIndividualWebProjectionByUuidIn(uuids); List subjectTypeUUIDs = projections.stream().map(individualWebProjection -> individualWebProjection.getSubjectType().getUuid()).distinct().collect(Collectors.toList()); accessControlService.checkSubjectPrivilege(PrivilegeType.ViewSubject, subjectTypeUUIDs); return projections;