From f4fe3b8d825fe652a836ea73667664b76035e818 Mon Sep 17 00:00:00 2001 From: tcdlpds Date: Wed, 22 May 2024 12:08:57 +0530 Subject: [PATCH] Fix SQL issue in app uninstall feature --- .../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 243ce17bf4..0aa4656866 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 @@ -1034,11 +1034,12 @@ public class GenericSubscriptionDAOImpl extends AbstractDAOImpl implements Subsc "AP_DEVICE_SUBSCRIPTION.AP_APP_RELEASE_ID = AP_APP_RELEASE.AP_APP_ID " + "WHERE PACKAGE_NAME = ? " + "AND DM_DEVICE_ID = ? " + - "AND UNSUBSCRIBED = 'FALSE' " + + "AND UNSUBSCRIBED = ? " + "AND STATUS = 'COMPLETED';"; try (PreparedStatement stmt = conn.prepareStatement(sql)) { stmt.setString(1, packageName); stmt.setInt(2, id); + stmt.setBoolean(3, false); try (ResultSet rs = stmt.executeQuery()) { if (rs.next()) { return rs.getString("UUID");