diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java index 3f3185a30d1..c5446035c8e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java @@ -436,6 +436,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); } deviceList.setList(devices); + deviceList.setCount(devices.size()); return Response.status(Response.Status.OK).entity(deviceList).build(); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java index 4e37aca0007..29cb889400d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java @@ -165,7 +165,7 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { stmt.setInt(paramIdx, tenantId); rs = stmt.executeQuery(); if (rs.next()) { - device = DeviceManagementDAOUtil.loadMatchingDevice(rs, true); + device = DeviceManagementDAOUtil.loadMatchingDevice(rs, false); } } catch (SQLException e) { throw new DeviceManagementDAOException("Error occurred while listing device for type " + 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 253e95fdd03..936f8f68f1a 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 @@ -145,10 +145,10 @@ public class QueryBuilderImpl implements QueryBuilder { ValueType type = new ValueType(); if (Utils.checkColumnType(con.getKey())) { type.setColumnType(ValueType.columnType.STRING); - type.setStringValue(Utils.getConvertedValue(con.getKey(), con.getValue())); + type.setStringValue(con.getValue()); } else { type.setColumnType(ValueType.columnType.INTEGER); - type.setIntValue(Integer.parseInt(Utils.getConvertedValue(con.getKey(), con.getValue()))); + type.setIntValue(Integer.parseInt(con.getValue())); } valueType[x] = type; x++; @@ -193,10 +193,10 @@ public class QueryBuilderImpl implements QueryBuilder { ValueType type = new ValueType(); if (Utils.checkColumnType(con.getKey())) { type.setColumnType(ValueType.columnType.STRING); - type.setStringValue(Utils.getConvertedValue(con.getKey(), con.getValue())); + type.setStringValue(con.getValue()); } else { type.setColumnType(ValueType.columnType.INTEGER); - type.setIntValue(Integer.parseInt(Utils.getConvertedValue(con.getKey(), con.getValue()))); + type.setIntValue(Integer.parseInt(con.getValue())); } valueType[x] = type; x++; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/search/mgt/impl/Utils.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/search/mgt/impl/Utils.java index 10e12f24ce5..9e0d044e1e0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/search/mgt/impl/Utils.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/search/mgt/impl/Utils.java @@ -103,14 +103,6 @@ public class Utils { return bool; } - public static String getConvertedValue(String column, String value) { - - if (checkColumnType(column)) { - return "\'" + value + "\'"; - } else return value; - - } - public static Map getDeviceDetailsColumnNames() { return genericColumnsMap; }