Solved test case failure.

revert-70ac1926
MalshaPiumini 4 years ago
parent b2691996ab
commit 60b59f455d

@ -90,15 +90,16 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
"d.DESCRIPTION, " + "d.DESCRIPTION, " +
"d.NAME, " + "d.NAME, " +
"d.DEVICE_IDENTIFICATION, " + "d.DEVICE_IDENTIFICATION, " +
"t.NAME AS DEVICE_TYPE " + "t.NAME AS DEVICE_TYPE ";
"FROM DM_DEVICE d, DM_DEVICE_TYPE t, DM_DEVICE_INFO i " +
"WHERE DEVICE_TYPE_ID = t.ID AND d.ID= i.DEVICE_ID AND i.KEY_FIELD='serial' ";
if (serial != null) { if (serial != null) {
sql = sql + "AND i.VALUE_FIELD = ? "; sql = sql + "FROM DM_DEVICE d, DM_DEVICE_TYPE t, DM_DEVICE_INFO i " +
"WHERE DEVICE_TYPE_ID = t.ID AND d.ID= i.DEVICE_ID " +
"AND i.KEY_FIELD='serial' AND i.VALUE_FIELD = ? AND d.TENANT_ID = ? ";
isSerialProvided = true; isSerialProvided = true;
} else {
sql = sql + "FROM DM_DEVICE d, DM_DEVICE_TYPE t WHERE DEVICE_TYPE_ID = t.ID AND d.TENANT_ID = ? ";
} }
sql = sql + "AND d.TENANT_ID = ?";
//Add query for last updated timestamp //Add query for last updated timestamp
if (since != null) { if (since != null) {
sql = sql + " AND d.LAST_UPDATED_TIMESTAMP > ?"; sql = sql + " AND d.LAST_UPDATED_TIMESTAMP > ?";

@ -90,15 +90,16 @@ public class OracleDeviceDAOImpl extends AbstractDeviceDAOImpl {
"d.DESCRIPTION, " + "d.DESCRIPTION, " +
"d.NAME, " + "d.NAME, " +
"d.DEVICE_IDENTIFICATION, " + "d.DEVICE_IDENTIFICATION, " +
"t.NAME AS DEVICE_TYPE " + "t.NAME AS DEVICE_TYPE ";
"FROM DM_DEVICE d, DM_DEVICE_TYPE t, DM_DEVICE_INFO i " +
"WHERE DEVICE_TYPE_ID = t.ID AND d.ID= i.DEVICE_ID AND i.KEY_FIELD='serial' ";
if (serial != null) { if (serial != null) {
sql = sql + "AND i.VALUE_FIELD = ? "; sql = sql + "FROM DM_DEVICE d, DM_DEVICE_TYPE t, DM_DEVICE_INFO i " +
"WHERE DEVICE_TYPE_ID = t.ID AND d.ID= i.DEVICE_ID " +
"AND i.KEY_FIELD='serial' AND i.VALUE_FIELD = ? AND d.TENANT_ID = ? ";
isSerialProvided = true; isSerialProvided = true;
} else {
sql = sql + "FROM DM_DEVICE d, DM_DEVICE_TYPE t WHERE DEVICE_TYPE_ID = t.ID AND d.TENANT_ID = ? ";
} }
sql = sql + "AND d.TENANT_ID = ?";
//Add query for last updated timestamp //Add query for last updated timestamp
if (since != null) { if (since != null) {
sql = sql + " AND d.LAST_UPDATED_TIMESTAMP > ?"; sql = sql + " AND d.LAST_UPDATED_TIMESTAMP > ?";

@ -89,15 +89,16 @@ public class PostgreSQLDeviceDAOImpl extends AbstractDeviceDAOImpl {
"d.DESCRIPTION, " + "d.DESCRIPTION, " +
"d.NAME, " + "d.NAME, " +
"d.DEVICE_IDENTIFICATION, " + "d.DEVICE_IDENTIFICATION, " +
"t.NAME AS DEVICE_TYPE " + "t.NAME AS DEVICE_TYPE ";
"FROM DM_DEVICE d, DM_DEVICE_TYPE t, DM_DEVICE_INFO i " +
"WHERE DEVICE_TYPE_ID = t.ID AND d.ID= i.DEVICE_ID AND i.KEY_FIELD='serial' ";
if (serial != null) { if (serial != null) {
sql = sql + "AND i.VALUE_FIELD = ? "; sql = sql + "FROM DM_DEVICE d, DM_DEVICE_TYPE t, DM_DEVICE_INFO i " +
"WHERE DEVICE_TYPE_ID = t.ID AND d.ID= i.DEVICE_ID " +
"AND i.KEY_FIELD='serial' AND i.VALUE_FIELD = ? AND d.TENANT_ID = ? ";
isSerialProvided = true; isSerialProvided = true;
} else {
sql = sql + "FROM DM_DEVICE d, DM_DEVICE_TYPE t WHERE DEVICE_TYPE_ID = t.ID AND d.TENANT_ID = ? ";
} }
sql = sql + "AND d.TENANT_ID = ?";
//Add the query for device-type //Add the query for device-type
if (deviceType != null && !deviceType.isEmpty()) { if (deviceType != null && !deviceType.isEmpty()) {
sql = sql + " AND t.NAME = ?"; sql = sql + " AND t.NAME = ?";

@ -91,15 +91,16 @@ public class SQLServerDeviceDAOImpl extends AbstractDeviceDAOImpl {
"d.DESCRIPTION, " + "d.DESCRIPTION, " +
"d.NAME, " + "d.NAME, " +
"d.DEVICE_IDENTIFICATION, " + "d.DEVICE_IDENTIFICATION, " +
"t.NAME AS DEVICE_TYPE " + "t.NAME AS DEVICE_TYPE ";
"FROM DM_DEVICE d, DM_DEVICE_TYPE t, DM_DEVICE_INFO i " +
"WHERE DEVICE_TYPE_ID = t.ID AND d.ID= i.DEVICE_ID AND i.KEY_FIELD='serial' ";
if (serial != null) { if (serial != null) {
sql = sql + "AND i.VALUE_FIELD = ? "; sql = sql + "FROM DM_DEVICE d, DM_DEVICE_TYPE t, DM_DEVICE_INFO i " +
"WHERE DEVICE_TYPE_ID = t.ID AND d.ID= i.DEVICE_ID " +
"AND i.KEY_FIELD='serial' AND i.VALUE_FIELD = ? AND d.TENANT_ID = ? ";
isSerialProvided = true; isSerialProvided = true;
} else {
sql = sql + "FROM DM_DEVICE d, DM_DEVICE_TYPE t WHERE DEVICE_TYPE_ID = t.ID AND d.TENANT_ID = ? ";
} }
sql = sql + "AND d.TENANT_ID = ?";
//Add query for last updated timestamp //Add query for last updated timestamp
if (since != null) { if (since != null) {
sql = sql + " AND d.LAST_UPDATED_TIMESTAMP > ?"; sql = sql + " AND d.LAST_UPDATED_TIMESTAMP > ?";

Loading…
Cancel
Save