From d7c942f39526754b5901656ca6f1750e1c3d9da5 Mon Sep 17 00:00:00 2001 From: Kamidu Sachith Date: Tue, 10 Nov 2015 14:51:10 +0530 Subject: [PATCH] Enable ownership editing on the policy --- .../carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java index 9cc11640d6..593c4a88fc 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/dao/impl/PolicyDAOImpl.java @@ -280,14 +280,15 @@ public class PolicyDAOImpl implements PolicyDAO { try { conn = this.getConnection(); - String query = "UPDATE DM_POLICY SET PRIORITY = ?, UPDATED = ? WHERE ID = ? AND TENANT_ID = ?"; + String query = "UPDATE DM_POLICY SET PRIORITY = ?, UPDATED = ?, OWNERSHIP_TYPE = ? WHERE ID = ? AND TENANT_ID = ?"; stmt = conn.prepareStatement(query); for (Policy policy : policies) { stmt.setInt(1, policy.getPriorityId()); stmt.setInt(2, 1); - stmt.setInt(3, policy.getId()); - stmt.setInt(4, tenantId); + stmt.setString(3, policy.getOwnershipType()); + stmt.setInt(4, policy.getId()); + stmt.setInt(5, tenantId); stmt.addBatch(); } stmt.executeBatch();