From d7fbddf78d86154bfe5ba000912c58b7956bcb52 Mon Sep 17 00:00:00 2001 From: lasanthaDLPDS Date: Wed, 6 Nov 2019 00:15:54 +0530 Subject: [PATCH 1/2] Fix app uninstall-operation-mapping table updating issue --- .../application/mgt/core/impl/SubscriptionManagerImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java index c9f4d0e4a1..6b68458a17 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java @@ -759,6 +759,8 @@ public class SubscriptionManagerImpl implements SubscriptionManager { } else if (SubAction.UNINSTALL.toString().equalsIgnoreCase(action)) { subUpdatingDeviceIds.addAll(getOperationAddedDeviceIds(activity, subscribingDeviceIdHolder.getAppInstalledDevices())); + subUpdatingDeviceIds.addAll(getOperationAddedDeviceIds(activity, + subscribingDeviceIdHolder.getAppReUnInstallableDevices())); } subscriptionDAO.addDeviceSubscription(username, subInsertingDeviceIds, subType, From f330bdd3d1b83f2c31ee0bd50cb4783c9a9e6822 Mon Sep 17 00:00:00 2001 From: lasanthaDLPDS Date: Wed, 6 Nov 2019 00:21:52 +0530 Subject: [PATCH 2/2] 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)) {