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 22661d93fe5..aa99cbd731b 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,10 +135,10 @@ 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.parentLocCode=?2 AND l.hierarchyLevel=?3 AND l.langCode=?4 AND l.isActive=true" ) + @Query("FROM Location l WHERE l.name=?1 AND l.parentLocCode=?2 AND l.hierarchyLevel=?3 AND l.langCode=?4 AND (l.isDeleted is null or l.isDeleted=false)" ) List findByNameParentCodeAndLevelLangCode(String name, String parentCode,Short hierarchyLevel, String langCode);