diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/search/mgt/impl/QueryBuilderImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/search/mgt/impl/QueryBuilderImpl.java index 9dc36109c4..cf4d2a03d6 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/search/mgt/impl/QueryBuilderImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/search/mgt/impl/QueryBuilderImpl.java @@ -50,8 +50,8 @@ public Map> buildQueries(List conditions) throws if (conditions.get(0).getKey().equalsIgnoreCase(Constants.LOCATION)) { locConditon = conditions.get(0); - } else if (Utils.getDeviceDetailsColumnNames().containsKey(conditions.get(0)) || - Utils.getDeviceLocationColumnNames().containsKey(conditions.get(0))) { + } else if (Utils.getDeviceDetailsColumnNames().containsKey(conditions.get(0).getKey()) || + Utils.getDeviceLocationColumnNames().containsKey(conditions.get(0).getKey())) { andColumns.add(conditions.get(0)); } else { otherANDColumns.add(conditions.get(0));