From f330bdd3d1b83f2c31ee0bd50cb4783c9a9e6822 Mon Sep 17 00:00:00 2001 From: lasanthaDLPDS Date: Wed, 6 Nov 2019 00:21:52 +0530 Subject: [PATCH] Fix SQL syntax issue in getSubscribedDevices method --- .../device/mgt/core/dao/impl/device/OracleDeviceDAOImpl.java | 2 +- .../device/mgt/core/dao/impl/device/SQLServerDeviceDAOImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/OracleDeviceDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/OracleDeviceDAOImpl.java index d09b53fa3c..9cd59077a9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/OracleDeviceDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/OracleDeviceDAOImpl.java @@ -630,7 +630,7 @@ public class OracleDeviceDAOImpl extends AbstractDeviceDAOImpl { isStatusProvided = true; } - query = query + " ORDER BY ENROLMENT_ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY"; + query = query + " ORDER BY DM_DEVICE.ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY"; try (PreparedStatement ps = conn.prepareStatement(query)) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/SQLServerDeviceDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/SQLServerDeviceDAOImpl.java index ad6c887cf7..706dee6148 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/SQLServerDeviceDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/device/SQLServerDeviceDAOImpl.java @@ -565,7 +565,7 @@ public class SQLServerDeviceDAOImpl extends AbstractDeviceDAOImpl { isStatusProvided = true; } - query = query + " ORDER BY f.ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY"; + query = query + " ORDER BY DM_DEVICE.ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY"; try (PreparedStatement ps = conn.prepareStatement(query)) {