mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge pull request #699 from Megala21/master
Fixes https://github.com/wso2/product-iots/issues/373 and https://github.com/wso2/product-iots/issues/370
This commit is contained in:
commit
91e0e3978c
@ -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();
|
||||
}
|
||||
|
||||
|
||||
@ -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 " +
|
||||
|
||||
@ -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++;
|
||||
|
||||
@ -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<String, String> getDeviceDetailsColumnNames() {
|
||||
return genericColumnsMap;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user