From 0c068635595094e71c72f6e6168e9dad9fee7886 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Sat, 19 Oct 2019 00:35:35 +0530 Subject: [PATCH] Add missing policy type in policy update query --- .../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 23a32a1a6b..be140bae71 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 @@ -921,7 +921,7 @@ public class PolicyDAOImpl implements PolicyDAO { try { conn = this.getConnection(); String query = "UPDATE DM_POLICY SET NAME = ?, PROFILE_ID = ?, PRIORITY = ?, COMPLIANCE = ?," + - " UPDATED = ?, DESCRIPTION = ?, OWNERSHIP_TYPE = ? WHERE ID = ? AND TENANT_ID = ?"; + " UPDATED = ?, DESCRIPTION = ?, OWNERSHIP_TYPE = ?, POLICY_TYPE = ? WHERE ID = ? AND TENANT_ID = ?"; stmt = conn.prepareStatement(query); stmt.setString(1, policy.getPolicyName()); stmt.setInt(2, policy.getProfile().getProfileId()); @@ -930,8 +930,9 @@ public class PolicyDAOImpl implements PolicyDAO { stmt.setInt(5, 1); stmt.setString(6, policy.getDescription()); stmt.setString(7, policy.getOwnershipType()); - stmt.setInt(8, policy.getId()); - stmt.setInt(9, tenantId); + stmt.setString(8, policy.getPolicyType()); + stmt.setInt(9, policy.getId()); + stmt.setInt(10, tenantId); stmt.executeUpdate(); } catch (SQLException e) {