From 2b7d24aa81517aae7fc4f5675f43fa6730e7445a Mon Sep 17 00:00:00 2001 From: Pasindu Yeshan Date: Thu, 26 Oct 2023 14:38:36 +0530 Subject: [PATCH] Fix v2 role update --- .../wso2/carbon/identity/role/v2/mgt/core/RoleConstants.java | 1 + .../wso2/carbon/identity/role/v2/mgt/core/dao/RoleDAOImpl.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/components/role-mgt/org.wso2.carbon.identity.role.v2.mgt.core/src/main/java/org/wso2/carbon/identity/role/v2/mgt/core/RoleConstants.java b/components/role-mgt/org.wso2.carbon.identity.role.v2.mgt.core/src/main/java/org/wso2/carbon/identity/role/v2/mgt/core/RoleConstants.java index 663fde08a468..c39ce6393d83 100644 --- a/components/role-mgt/org.wso2.carbon.identity.role.v2.mgt.core/src/main/java/org/wso2/carbon/identity/role/v2/mgt/core/RoleConstants.java +++ b/components/role-mgt/org.wso2.carbon.identity.role.v2.mgt.core/src/main/java/org/wso2/carbon/identity/role/v2/mgt/core/RoleConstants.java @@ -98,6 +98,7 @@ public static class RoleTableColumns { public static final String UM_MAIN_ROLE_TENANT_ID = "UM_MAIN_ROLE_TENANT_ID"; public static final String UM_GROUP_ID = "UM_GROUP_ID"; public static final String GROUP_NAME = "GROUP_NAME"; + public static final String ID = "ID"; public static final String NEW_ROLE_NAME = "NEW_ROLE_NAME"; public static final String USER_NOT_FOUND_ERROR_MESSAGE = "A user doesn't exist with name: %s " + diff --git a/components/role-mgt/org.wso2.carbon.identity.role.v2.mgt.core/src/main/java/org/wso2/carbon/identity/role/v2/mgt/core/dao/RoleDAOImpl.java b/components/role-mgt/org.wso2.carbon.identity.role.v2.mgt.core/src/main/java/org/wso2/carbon/identity/role/v2/mgt/core/dao/RoleDAOImpl.java index 8a6ef8f71c63..143c5df1c2b2 100644 --- a/components/role-mgt/org.wso2.carbon.identity.role.v2.mgt.core/src/main/java/org/wso2/carbon/identity/role/v2/mgt/core/dao/RoleDAOImpl.java +++ b/components/role-mgt/org.wso2.carbon.identity.role.v2.mgt.core/src/main/java/org/wso2/carbon/identity/role/v2/mgt/core/dao/RoleDAOImpl.java @@ -1191,7 +1191,7 @@ private void updateSharedSCIMRolesName(List sharedRoles, String newRole for (RoleDTO roleDTO : sharedRoles) { try (NamedPreparedStatement statement = new NamedPreparedStatement(connection, UPDATE_SCIM_ROLE_NAME_SQL, - RoleConstants.RoleTableColumns.UM_ID)) { + RoleConstants.RoleTableColumns.ID)) { statement.setString(RoleConstants.RoleTableColumns.NEW_ROLE_NAME, newRoleName); statement.setInt(RoleConstants.RoleTableColumns.TENANT_ID, roleDTO.getTenantId()); statement.setString(ROLE_NAME, roleDTO.getName());