From 8b61bbabeab7d2417107dc276d93baebd17658d1 Mon Sep 17 00:00:00 2001 From: Vinojini Paramasivam Date: Thu, 26 Sep 2019 04:11:55 +0000 Subject: [PATCH] Change search by group name to case insensitive --- .../service/impl/admin/GroupManagementAdminServiceImpl.java | 4 ++-- .../device/mgt/core/dao/impl/group/GenericGroupDAOImpl.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/GroupManagementAdminServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/GroupManagementAdminServiceImpl.java index 0668b30c4e..5c0537d2d3 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/GroupManagementAdminServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/GroupManagementAdminServiceImpl.java @@ -40,8 +40,8 @@ public class GroupManagementAdminServiceImpl implements GroupManagementAdminServ try { RequestValidationUtil.validatePaginationParameters(offset, limit); GroupPaginationRequest request = new GroupPaginationRequest(offset, limit); - request.setGroupName(name); - request.setOwner(owner); + request.setGroupName(name.toUpperCase()); + request.setOwner(owner.toUpperCase()); PaginationResult deviceGroupsResult = DeviceMgtAPIUtils.getGroupManagementProviderService() .getGroups(request); DeviceGroupList deviceGroupList = new DeviceGroupList(); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/group/GenericGroupDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/group/GenericGroupDAOImpl.java index 584a4f9a45..8ef981e701 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/group/GenericGroupDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/group/GenericGroupDAOImpl.java @@ -55,11 +55,11 @@ public class GenericGroupDAOImpl extends AbstractGroupDAOImpl { Connection conn = GroupManagementDAOFactory.getConnection(); String sql = "SELECT ID, DESCRIPTION, GROUP_NAME, OWNER FROM DM_GROUP WHERE TENANT_ID = ?"; if (groupName != null && !groupName.isEmpty()) { - sql += " AND GROUP_NAME LIKE ?"; + sql += " AND UPPER(GROUP_NAME) LIKE ?"; hasGroupName = true; } if (owner != null && !owner.isEmpty()) { - sql += " AND OWNER LIKE ?"; + sql += " AND UPPER(OWNER) LIKE ?"; hasOwner = true; } if (hasLimit) {