Fix issues in returning type in allsubscriptions

#11349
prathabanKavin 4 months ago
parent e024283f25
commit aa9f3da380

@ -611,7 +611,7 @@ public abstract class AbstractEnrollmentDAOImpl implements EnrollmentDAO {
throws DeviceManagementDAOException {
OwnerWithDeviceDTO deviceOwnerWithStatus = new OwnerWithDeviceDTO();
Connection conn = null;
String sql = "SELECT e.DEVICE_ID, e.OWNER, e.STATUS AS DEVICE_STATUS, d.NAME AS DEVICE_NAME " +
String sql = "SELECT e.DEVICE_ID, e.OWNER, e.STATUS AS DEVICE_STATUS, d.NAME AS DEVICE_NAME, e.DEVICE_TYPE, e.DEVICE_IDENTIFICATION " +
"FROM DM_ENROLMENT e " +
"JOIN DM_DEVICE d ON e.DEVICE_ID = d.ID " +
"WHERE e.DEVICE_ID = ? AND e.TENANT_ID = ?";
@ -629,6 +629,8 @@ public abstract class AbstractEnrollmentDAOImpl implements EnrollmentDAO {
deviceIds.add(rs.getInt("DEVICE_ID"));
deviceOwnerWithStatus.setDeviceIds(deviceIds);
deviceOwnerWithStatus.setDeviceNames(rs.getString("DEVICE_NAME"));
deviceOwnerWithStatus.setDeviceTypes(rs.getString("DEVICE_TYPE"));
deviceOwnerWithStatus.setDeviceIdentifiers(rs.getString("DEVICE_IDENTIFICATION"));
}
}
}
@ -644,7 +646,9 @@ public abstract class AbstractEnrollmentDAOImpl implements EnrollmentDAO {
public List<DeviceDetailsDTO> getDevicesByTenantId(int tenantId)
throws DeviceManagementDAOException {
List<DeviceDetailsDTO> devices = new ArrayList<>();
String sql = "SELECT DEVICE_ID, OWNER, STATUS FROM DM_ENROLMENT WHERE TENANT_ID = ?";
String sql = "SELECT DEVICE_ID, OWNER, STATUS, DEVICE_TYPE, DEVICE_IDENTIFICATION " +
"FROM DM_ENROLMENT " +
"WHERE TENANT_ID = ?";
Connection conn = null;
try {
@ -658,6 +662,8 @@ public abstract class AbstractEnrollmentDAOImpl implements EnrollmentDAO {
device.setDeviceId(rs.getInt("DEVICE_ID"));
device.setOwner(rs.getString("OWNER"));
device.setStatus(rs.getString("STATUS"));
device.setType(rs.getString("DEVICE_TYPE"));
device.setDeviceIdentifier(rs.getString("DEVICE_IDENTIFICATION"));
devices.add(device);
}
}

@ -22,6 +22,8 @@ public class DeviceDetailsDTO {
private int deviceId;
private String owner;
private String status;
private String type;
private String deviceIdentifier;
public int getDeviceId() {
return deviceId;
@ -46,4 +48,20 @@ public class DeviceDetailsDTO {
public void setStatus(String status) {
this.status = status;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getDeviceIdentifier() {
return deviceIdentifier;
}
public void setDeviceIdentifier(String deviceIdentifier) {
this.deviceIdentifier = deviceIdentifier;
}
}

Loading…
Cancel
Save