From d15f19dab296d522ab4b2a1bbd7e767a309a3b57 Mon Sep 17 00:00:00 2001 From: manoj Date: Fri, 29 May 2015 17:38:19 +0530 Subject: [PATCH] correct sql ambiguos selection of operation id --- .../core/operation/mgt/dao/impl/ConfigOperationDAOImpl.java | 4 ++-- .../core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java | 2 +- .../core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ConfigOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ConfigOperationDAOImpl.java index d14188c2a6..03d1b080de 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ConfigOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ConfigOperationDAOImpl.java @@ -182,10 +182,10 @@ public class ConfigOperationDAOImpl extends OperationDAOImpl { try { Connection conn = OperationManagementDAOFactory.getConnection(); - String sql = "Select OPERATION_ID, ENABLED, OPERATION_DETAILS from DM_POLICY_OPERATION po " + + String sql = "Select co.OPERATION_ID, ENABLED, OPERATION_DETAILS from DM_CONFIG_OPERATION co " + "INNER JOIN " + "(Select * From DM_DEVICE_OPERATION_MAPPING WHERE DEVICE_ID=? " + - "AND STATUS=?) dm ON dm.OPERATION_ID = po.OPERATION_ID"; + "AND STATUS=?) dm ON dm.OPERATION_ID = co.OPERATION_ID"; stmt = conn.prepareStatement(sql); stmt.setInt(1, deviceId); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java index 591af16ce8..d1156c9d25 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java @@ -185,7 +185,7 @@ public class PolicyOperationDAOImpl extends OperationDAOImpl { try { Connection conn = OperationManagementDAOFactory.getConnection(); - String sql = "Select OPERATION_ID, ENABLED, OPERATION_DETAILS from DM_POLICY_OPERATION po " + + String sql = "Select po.OPERATION_ID, ENABLED, OPERATION_DETAILS from DM_POLICY_OPERATION po " + "INNER JOIN " + "(Select * From DM_DEVICE_OPERATION_MAPPING WHERE DEVICE_ID=? " + "AND STATUS=?) dm ON dm.OPERATION_ID = po.OPERATION_ID"; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java index 036b4131cd..23369f7ee1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java @@ -181,7 +181,7 @@ public class ProfileOperationDAOImpl extends OperationDAOImpl { try { Connection conn = OperationManagementDAOFactory.getConnection(); - String sql = "Select OPERATION_ID, ENABLED, OPERATION_DETAILS from DM_PROFILE_OPERATION po " + + String sql = "Select po.OPERATION_ID, ENABLED, OPERATION_DETAILS from DM_PROFILE_OPERATION po " + "INNER JOIN " + "(Select * From DM_DEVICE_OPERATION_MAPPING WHERE DEVICE_ID=? " + "AND STATUS=?) dm ON dm.OPERATION_ID = po.OPERATION_ID";