megala21 8 years ago
parent 16d97d62be
commit 32ea2e52c4

@ -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…
Cancel
Save