From 0647eee0d8b534e9ee3c1698468de89e6e4b007e Mon Sep 17 00:00:00 2001 From: Pahansith Date: Fri, 22 May 2020 00:45:41 +0530 Subject: [PATCH] Fix device syntax error in device large response delete --- .../device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java index ff56439f04..3d279928f6 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java @@ -2417,11 +2417,10 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { private void removeDeviceLargeOperationResponse(Connection conn, List enrollmentIds) throws DeviceManagementDAOException { - String sql = "DELETE DM_DEVICE_OPERATION_RESPONSE_LARGE " + - "FROM DM_DEVICE_OPERATION_RESPONSE_LARGE " + - "INNER JOIN DM_DEVICE_OPERATION_RESPONSE ON DM_DEVICE_OPERATION_RESPONSE_LARGE.ID = " + - "DM_DEVICE_OPERATION_RESPONSE.ID " + - "WHERE ENROLMENT_ID = ?"; + String sql = "DELETE FROM DM_DEVICE_OPERATION_RESPONSE_LARGE " + + "WHERE EXISTS (SELECT ID FROM DM_DEVICE_OPERATION_RESPONSE " + + "WHERE DM_DEVICE_OPERATION_RESPONSE.ID = DM_DEVICE_OPERATION_RESPONSE_LARGE.ID " + + "AND DM_DEVICE_OPERATION_RESPONSE.ENROLMENT_ID = ?)"; try { if (!executeBatchOperation(conn, sql, enrollmentIds)) { String msg = "Failed to remove device large operation response of devices with " +