From 363dbeeef8d07b353981ccf85f1d4fd003b88c75 Mon Sep 17 00:00:00 2001 From: hilpitome Date: Wed, 29 Jun 2022 16:35:29 +0300 Subject: [PATCH] find parent location when parentId isnull --- pom.xml | 2 +- .../org/opensrp/repository/postgres/LocationRepositoryImpl.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c0d172209..87bc643d6 100755 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ opensrp-server-core jar - 2.14.1-SNAPSHOT + 2.14.2-SNAPSHOT opensrp-server-core OpenSRP Server Core module https://github.com/OpenSRP/opensrp-server-core diff --git a/src/main/java/org/opensrp/repository/postgres/LocationRepositoryImpl.java b/src/main/java/org/opensrp/repository/postgres/LocationRepositoryImpl.java index 758824d05..ef2662c8e 100644 --- a/src/main/java/org/opensrp/repository/postgres/LocationRepositoryImpl.java +++ b/src/main/java/org/opensrp/repository/postgres/LocationRepositoryImpl.java @@ -365,6 +365,8 @@ public List findLocationsByProperties(boolean returnGeometry, LocationMetadataExample locationMetadataExample = new LocationMetadataExample(); if (parentId != null) { locationMetadataExample.createCriteria().andParentIdEqualTo(parentId); + } else { + locationMetadataExample.createCriteria().andParentIdIsNull(); } List locations = locationMetadataMapper.selectManyByProperties(locationMetadataExample, properties, returnGeometry, 0, DEFAULT_FETCH_SIZE);