Source:
public void updateGroupListOfHybridRole(String roleName, String[] deletedGroups, String[] newGroups) throws UserStoreException { String sqlStmt1 = HybridJDBCConstants.REMOVE_GROUP_FROM_ROLE_SQL; String sqlStmt2 = HybridJDBCConstants.ADD_GROUP_TO_ROLE_SQL; try (Connection dbConnection = DatabaseUtil.getDBConnection(dataSource)) { String primaryDomainName = getMyDomainName(); if (primaryDomainName != null) { primaryDomainName = primaryDomainName.toUpperCase(); } String type = DatabaseCreator.getDatabaseType(dbConnection); if (UserCoreConstants.MSSQL_TYPE.equals(type)) { sqlStmt2 = HybridJDBCConstants.ADD_GROUP_TO_ROLE_SQL_MSSQL; } if (ArrayUtils.isNotEmpty(deletedGroups)) { DatabaseUtil.udpateUserRoleMappingInBatchModeForInternalRoles(dbConnection, sqlStmt1, primaryDomainName, deletedGroups, roleName, tenantId, tenantId, tenantId); } if (ArrayUtils.isNotEmpty(newGroups)) { if (UserCoreConstants.OPENEDGE_TYPE.equals(type)) { sqlStmt2 = HybridJDBCConstants.ADD_GROUP_TO_ROLE_SQL_OPENEDGE; DatabaseUtil .udpateUserRoleMappingInBatchModeForInternalRoles(dbConnection, sqlStmt2, primaryDomainName, newGroups, tenantId, roleName, tenantId); } else { DatabaseUtil .udpateUserRoleMappingInBatchModeForInternalRoles(dbConnection, sqlStmt2, primaryDomainName, newGroups, roleName, tenantId, tenantId, tenantId); } } dbConnection.commit(); } catch (SQLException | UserStoreException e) { String errorMessage = "Error occurred while updating user list of hybrid role : " + roleName; if (log.isDebugEnabled()) { log.debug(errorMessage, e); } throw new UserStoreException(errorMessage, e); } catch (Exception e) { String errorMessage = "Error occurred while getting database type from DB connection"; if (log.isDebugEnabled()) { log.debug(errorMessage, e); } throw new UserStoreException(errorMessage, e); } }

Target:
public void updateGroupListOfHybridRole(String roleName, String[] deletedGroups, String[] newGroups) throws UserStoreException { String sqlStmt1 = HybridJDBCConstants.REMOVE_GROUP_FROM_ROLE_SQL; String sqlStmt2 = HybridJDBCConstants.ADD_GROUP_TO_ROLE_SQL; try (Connection dbConnection = DatabaseUtil.getDBConnection(dataSource)) { String domainName = getMyDomainName(); if (domainName != null) { domainName = domainName.toUpperCase(); } String type = DatabaseCreator.getDatabaseType(dbConnection); if (UserCoreConstants.MSSQL_TYPE.equals(type)) { sqlStmt2 = HybridJDBCConstants.ADD_GROUP_TO_ROLE_SQL_MSSQL; } if (ArrayUtils.isNotEmpty(deletedGroups)) { DatabaseUtil.udpateUserRoleMappingInBatchModeForInternalRoles(dbConnection, sqlStmt1, domainName, deletedGroups, roleName, tenantId, tenantId, tenantId); } if (ArrayUtils.isNotEmpty(newGroups)) { if (UserCoreConstants.OPENEDGE_TYPE.equals(type)) { sqlStmt2 = HybridJDBCConstants.ADD_GROUP_TO_ROLE_SQL_OPENEDGE; DatabaseUtil.udpateUserRoleMappingInBatchModeForInternalRoles(dbConnection, sqlStmt2, domainName, newGroups, tenantId, roleName, tenantId); } else { DatabaseUtil.udpateUserRoleMappingInBatchModeForInternalRoles(dbConnection, sqlStmt2, domainName, newGroups, roleName, tenantId, tenantId, tenantId); } } dbConnection.commit(); } catch (SQLException | UserStoreException e) { String errorMessage = "Error occurred while updating user list of hybrid role : " + roleName; if (log.isDebugEnabled()) { log.debug(errorMessage, e); } throw new UserStoreException(errorMessage, e); } catch (Exception e) { String errorMessage = "Error occurred while getting database type from DB connection"; if (log.isDebugEnabled()) { log.debug(errorMessage, e); } throw new UserStoreException(errorMessage, e); } }