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/GenericApplicationDAOImpl.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/GenericApplicationDAOImpl.java index 57fdd4021a1..b0d4f7f3815 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/GenericApplicationDAOImpl.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/GenericApplicationDAOImpl.java @@ -99,7 +99,6 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic log.debug("Getting application data from the database"); log.debug(String.format("Filter: limit=%s, offset=%s", filter.getLimit(), filter.getOffset())); } - int paramIndex = 1; String sql = "SELECT " + "AP_APP.ID AS APP_ID, " + "AP_APP.NAME AS APP_NAME, " @@ -132,7 +131,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic + "FROM AP_APP " + "INNER JOIN AP_APP_RELEASE ON " + "AP_APP.ID = AP_APP_RELEASE.AP_APP_ID " - + "INNER JOIN (SELECT ID FROM AP_APP LIMIT ? OFFSET ? ) AS app_data ON app_data.ID = AP_APP.ID " + + "INNER JOIN (SELECT ID FROM AP_APP WHERE AP_APP.TENANT_ID = ? LIMIT ? OFFSET ? ) AS app_data ON app_data.ID = AP_APP.ID " + "WHERE AP_APP.TENANT_ID = ?"; if (filter == null) { @@ -183,8 +182,9 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic try { Connection conn = this.getDBConnection(); - try (PreparedStatement stmt = conn.prepareStatement(sql); - ){ + try (PreparedStatement stmt = conn.prepareStatement(sql)){ + int paramIndex = 1; + stmt.setInt(paramIndex++, tenantId); if (filter.getLimit() != -1) { if (filter.getLimit() == 0) { stmt.setInt(paramIndex++, 100); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/package.json b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/package.json index f0002c6fea5..d39cce7d495 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/package.json +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/package.json @@ -55,6 +55,7 @@ "babel-preset-stage-0": "^6.24.1", "body-parser": "^1.19.0", "chai": "^4.1.2", + "cross-env": "^7.0.0", "css-loader": "^0.28.11", "eslint": "^5.16.0", "eslint-config-prettier": "4.3.0", @@ -100,8 +101,8 @@ "watch": "webpack --watch --mode development", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject", - "build_prod": "NODE_ENV=production NODE_OPTIONS=--max_old_space_size=4096 webpack -p --display errors-only --hide-modules", - "build_dev": "NODE_ENV=development webpack -d --watch ", + "build_prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max_old_space_size=4096 webpack -p --display errors-only --hide-modules", + "build_dev": "cross-env NODE_ENV=development webpack -d --watch ", "server": "node-env-run server --exec nodemon | pino-colada", "dev2": "run-p server start", "lint": "eslint \"src/**/*.js\"" diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/package.json b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/package.json index db8ec651f86..56aa61b49bb 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/package.json +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/package.json @@ -44,6 +44,7 @@ "babel-loader": "^8.0.6", "body-parser": "^1.19.0", "chai": "^4.1.2", + "cross-env": "^7.0.0", "css-loader": "^0.28.11", "eslint": "^5.16.0", "eslint-config-prettier": "4.3.0", @@ -87,8 +88,8 @@ "watch": "webpack --watch --mode development", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject", - "build_prod": "NODE_ENV=production NODE_OPTIONS=--max_old_space_size=4096 webpack -p --display errors-only --hide-modules", - "build_dev": "NODE_ENV=development webpack -d --watch ", + "build_prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max_old_space_size=4096 webpack -p --display errors-only --hide-modules", + "build_dev": "cross-env NODE_ENV=development webpack -d --watch ", "server": "node-env-run server --exec nodemon | pino-colada", "dev2": "run-p server start", "lint": "eslint \"src/**/*.js\"" diff --git a/components/device-mgt/io.entgra.device.mgt.ui/react-app/package.json b/components/device-mgt/io.entgra.device.mgt.ui/react-app/package.json index f7442919735..84b0d6c4161 100644 --- a/components/device-mgt/io.entgra.device.mgt.ui/react-app/package.json +++ b/components/device-mgt/io.entgra.device.mgt.ui/react-app/package.json @@ -47,6 +47,7 @@ "babel-loader": "^8.0.6", "body-parser": "^1.19.0", "chai": "^4.1.2", + "cross-env": "^7.0.0", "css-loader": "^0.28.11", "eslint": "^5.16.0", "eslint-config-prettier": "4.3.0", @@ -91,8 +92,8 @@ "watch": "webpack --watch --mode development", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject", - "build_prod": "NODE_ENV=production NODE_OPTIONS=--max_old_space_size=4096 webpack -p --display errors-only --hide-modules", - "build_dev": "NODE_ENV=development webpack -d --watch ", + "build_prod": "cross-env NODE_ENV=production NODE_OPTIONS=--max_old_space_size=4096 webpack -p --display errors-only --hide-modules", + "build_dev": "cross-env NODE_ENV=development webpack -d --watch ", "server": "node-env-run server --exec nodemon | pino-colada", "dev2": "run-p server start", "lint": "eslint \"src/**/*.js\"" diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java index db865b1c5cf..290f5f7d108 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java @@ -156,7 +156,7 @@ public class DeviceDetailsDAOImpl implements DeviceDetailsDAO { Connection conn; PreparedStatement stmt = null; ResultSet rs = null; - DeviceInfo deviceInfo = null; + DeviceInfo deviceInfo = new DeviceInfo(); try { conn = this.getConnection(); @@ -167,7 +167,6 @@ public class DeviceDetailsDAOImpl implements DeviceDetailsDAO { rs = stmt.executeQuery(); if (rs.next()) { - deviceInfo = new DeviceInfo(); // deviceInfo.setIMEI(rs.getString("IMEI")); // deviceInfo.setIMSI(rs.getString("IMSI")); deviceInfo.setDeviceModel(rs.getString("DEVICE_MODEL"));