From 79e0c2d1ebceb06e4fef548c2456d686130a4c5b Mon Sep 17 00:00:00 2001 From: "osh.silva" Date: Thu, 27 Jun 2024 16:48:02 +0530 Subject: [PATCH 1/2] Add fix for multiple device app activity details retrieval --- .../core/dao/impl/subscription/GenericSubscriptionDAOImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java index 79e7b76660..fbdf896d68 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java @@ -1451,7 +1451,8 @@ public class GenericSubscriptionDAOImpl extends AbstractDAOImpl implements Subsc + "JOIN AP_DEVICE_SUBSCRIPTION DS ON SOP.AP_DEVICE_SUBSCRIPTION_ID = DS.ID " + "JOIN AP_APP_RELEASE AR ON DS.AP_APP_RELEASE_ID = AR.ID " + "JOIN AP_APP AP ON AP.ID = AR.AP_APP_ID " - + " WHERE SOP.OPERATION_ID = ? AND SOP.TENANT_ID = ?"; + + "WHERE SOP.OPERATION_ID = ? AND SOP.TENANT_ID = ? " + + "LIMIT 1"; Connection conn = this.getDBConnection(); try (PreparedStatement stmt = conn.prepareStatement(sql)) { -- 2.36.3 From 48a289b230fc35357b76a6b9e5402c85bffadb26 Mon Sep 17 00:00:00 2001 From: "osh.silva" Date: Sun, 30 Jun 2024 11:31:43 +0530 Subject: [PATCH 2/2] Remove unwanted status value from query --- .../core/dao/impl/subscription/GenericSubscriptionDAOImpl.java | 1 - .../device/mgt/core/application/mgt/core/util/DAOUtil.java | 1 - .../mgt/api/jaxrs/service/impl/ActivityProviderServiceImpl.java | 1 - 3 files changed, 3 deletions(-) diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java index fbdf896d68..cc3a289a4b 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java @@ -1445,7 +1445,6 @@ public class GenericSubscriptionDAOImpl extends AbstractDAOImpl implements Subsc + "AR.PACKAGE_NAME, " + "AR.VERSION, " + "DS.SUBSCRIBED_BY, " - + "DS.STATUS, " + "DS.ACTION_TRIGGERED_FROM " + "FROM AP_APP_SUB_OP_MAPPING SOP " + "JOIN AP_DEVICE_SUBSCRIPTION DS ON SOP.AP_DEVICE_SUBSCRIPTION_ID = DS.ID " diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/DAOUtil.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/DAOUtil.java index 2177c6ad13..6b06a7aa62 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/DAOUtil.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/DAOUtil.java @@ -383,7 +383,6 @@ public class DAOUtil { activity.setAppType(rs.getString("TYPE")); activity.setUsername(rs.getString("SUBSCRIBED_BY")); activity.setPackageName(rs.getString("PACKAGE_NAME")); - activity.setStatus(rs.getString("STATUS")); activity.setVersion(rs.getString("VERSION")); activity.setTriggeredBy(rs.getString("ACTION_TRIGGERED_FROM")); activities.add(activity); diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ActivityProviderServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ActivityProviderServiceImpl.java index a4148f07a8..bcfdb69aac 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ActivityProviderServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ActivityProviderServiceImpl.java @@ -175,7 +175,6 @@ public class ActivityProviderServiceImpl implements ActivityInfoProviderService activity.setUsername(appActivity.getUsername()); activity.setPackageName(appActivity.getPackageName()); activity.setAppName(appActivity.getAppName()); - activity.setStatus(appActivity.getStatus()); activity.setAppType(appActivity.getAppType()); activity.setVersion(appActivity.getVersion()); activity.setTriggeredBy(appActivity.getTriggeredBy()); -- 2.36.3