diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java index 3b247d886aa..7ca05d12a6a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java @@ -119,11 +119,11 @@ public class SQLServerApplicationDAOImpl extends GenericApplicationDAOImpl { } if (filter.getLimit() == -1) { - sql = sql.replace("OFFSET ? ROWS FETCH NEXT ? ROWS ONLY", ""); + sql = sql.replace("ORDER BY ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY", ""); } String sortingOrder = "ASC"; - if (!StringUtils.isEmpty(filter.getSortBy() )) { + if (!StringUtils.isEmpty(filter.getSortBy())) { sortingOrder = filter.getSortBy(); } sql += " ORDER BY APP_ID " + sortingOrder; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/MDMAndroidOperationUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/MDMAndroidOperationUtil.java index f9c90d6d1ae..14dbaea9ed0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/MDMAndroidOperationUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/MDMAndroidOperationUtil.java @@ -51,6 +51,7 @@ public class MDMAndroidOperationUtil { EnterpriseApplication enterpriseApplication = new EnterpriseApplication(); enterpriseApplication.setType(application.getType().toString()); enterpriseApplication.setUrl(application.getLocation()); + enterpriseApplication.setAppIdentifier(application.getIdentifier()); operation.setPayLoad(enterpriseApplication.toJSON()); break; case PUBLIC: