diff --git a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/repository/LocationRepository.java b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/repository/LocationRepository.java index dc942d14954..f0efed4fe1b 100644 --- a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/repository/LocationRepository.java +++ b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/repository/LocationRepository.java @@ -135,7 +135,7 @@ List findLocationByHierarchyLevelStartsWith(Short hierarchyLevel, Stri @Query("FROM Location l WHERE l.name=?1 AND l.hierarchyLevel=?2 ") List findByNameAndLevel(String name, Short hierarchyLevel); - @Query("FROM Location l WHERE l.name=?1 AND l.hierarchyLevel=?2 AND l.langCode=?3") + @Query("FROM Location l WHERE l.name=?1 AND l.hierarchyLevel=?2 AND l.langCode=?3 and (l.isDeleted is null or l.isDeleted=false)") List findByNameAndLevelLangCode(String name, Short hierarchyLevel, String langCode); @Query("FROM Location l WHERE l.name=?1 AND l.hierarchyLevel=?2 AND l.langCode=?3 AND NOT code=?4")