mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Fixed issue in NotificationDAO due to invalid column name
This commit is contained in:
parent
27a9eeb692
commit
1a12838b7c
@ -75,8 +75,8 @@ public abstract class AbstractNotificationDAOImpl implements NotificationDAO {
|
|||||||
try {
|
try {
|
||||||
conn = NotificationManagementDAOFactory.getConnection();
|
conn = NotificationManagementDAOFactory.getConnection();
|
||||||
String sql =
|
String sql =
|
||||||
"SELECT NOTIFICATION_ID, OPERATION_ID, DESCRIPTION, STATUS, DEVICE_IDENTIFICATION, DEVICE_NAME, " +
|
"SELECT NOTIFICATION_ID, OPERATION_ID, DESCRIPTION, STATUS FROM DM_NOTIFICATION WHERE " +
|
||||||
"DEVICE TYPE FROM DM_NOTIFICATION WHERE TENANT_ID = ? AND NOTIFICATION_ID = ?";
|
"TENANT_ID = ? AND NOTIFICATION_ID = ?";
|
||||||
stmt = conn.prepareStatement(sql);
|
stmt = conn.prepareStatement(sql);
|
||||||
stmt.setInt(1, tenantId);
|
stmt.setInt(1, tenantId);
|
||||||
stmt.setInt(2, notificationId);
|
stmt.setInt(2, notificationId);
|
||||||
@ -161,7 +161,7 @@ public abstract class AbstractNotificationDAOImpl implements NotificationDAO {
|
|||||||
rs = stmt.executeQuery();
|
rs = stmt.executeQuery();
|
||||||
notifications = new ArrayList<>();
|
notifications = new ArrayList<>();
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
notifications.add(NotificationDAOUtil.getNotification(rs));
|
notifications.add(NotificationDAOUtil.getNotificationWithDeviceInfo(rs));
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new NotificationManagementException(
|
throw new NotificationManagementException(
|
||||||
@ -234,7 +234,7 @@ public abstract class AbstractNotificationDAOImpl implements NotificationDAO {
|
|||||||
rs = stmt.executeQuery();
|
rs = stmt.executeQuery();
|
||||||
notifications = new ArrayList<>();
|
notifications = new ArrayList<>();
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
notifications.add(NotificationDAOUtil.getNotification(rs));
|
notifications.add(NotificationDAOUtil.getNotificationWithDeviceInfo(rs));
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new NotificationManagementException(
|
throw new NotificationManagementException(
|
||||||
|
|||||||
@ -126,6 +126,15 @@ public class NotificationDAOUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Notification getNotification(ResultSet rs) throws SQLException {
|
public static Notification getNotification(ResultSet rs) throws SQLException {
|
||||||
|
Notification notification = new Notification();
|
||||||
|
notification.setNotificationId(rs.getInt("NOTIFICATION_ID"));
|
||||||
|
notification.setOperationId(rs.getInt("OPERATION_ID"));
|
||||||
|
notification.setDescription(rs.getString("DESCRIPTION"));
|
||||||
|
notification.setStatus(rs.getString("STATUS"));
|
||||||
|
return notification;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Notification getNotificationWithDeviceInfo(ResultSet rs) throws SQLException {
|
||||||
Notification notification = new Notification();
|
Notification notification = new Notification();
|
||||||
notification.setNotificationId(rs.getInt("NOTIFICATION_ID"));
|
notification.setNotificationId(rs.getInt("NOTIFICATION_ID"));
|
||||||
notification.setOperationId(rs.getInt("OPERATION_ID"));
|
notification.setOperationId(rs.getInt("OPERATION_ID"));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user