Merge branch 'master' of https://gitlab.com/entgra/carbon-device-mgt into entgra-master

4.x.x
Charitha Goonetilleke 5 years ago
commit d5101ff98a

@ -99,7 +99,6 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
log.debug("Getting application data from the database"); log.debug("Getting application data from the database");
log.debug(String.format("Filter: limit=%s, offset=%s", filter.getLimit(), filter.getOffset())); log.debug(String.format("Filter: limit=%s, offset=%s", filter.getLimit(), filter.getOffset()));
} }
int paramIndex = 1;
String sql = "SELECT " String sql = "SELECT "
+ "AP_APP.ID AS APP_ID, " + "AP_APP.ID AS APP_ID, "
+ "AP_APP.NAME AS APP_NAME, " + "AP_APP.NAME AS APP_NAME, "
@ -132,7 +131,7 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
+ "FROM AP_APP " + "FROM AP_APP "
+ "INNER JOIN AP_APP_RELEASE ON " + "INNER JOIN AP_APP_RELEASE ON "
+ "AP_APP.ID = AP_APP_RELEASE.AP_APP_ID " + "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 = ?"; + "WHERE AP_APP.TENANT_ID = ?";
if (filter == null) { if (filter == null) {
@ -183,8 +182,9 @@ public class GenericApplicationDAOImpl extends AbstractDAOImpl implements Applic
try { try {
Connection conn = this.getDBConnection(); 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() != -1) {
if (filter.getLimit() == 0) { if (filter.getLimit() == 0) {
stmt.setInt(paramIndex++, 100); stmt.setInt(paramIndex++, 100);

@ -55,6 +55,7 @@
"babel-preset-stage-0": "^6.24.1", "babel-preset-stage-0": "^6.24.1",
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
"chai": "^4.1.2", "chai": "^4.1.2",
"cross-env": "^7.0.0",
"css-loader": "^0.28.11", "css-loader": "^0.28.11",
"eslint": "^5.16.0", "eslint": "^5.16.0",
"eslint-config-prettier": "4.3.0", "eslint-config-prettier": "4.3.0",
@ -100,8 +101,8 @@
"watch": "webpack --watch --mode development", "watch": "webpack --watch --mode development",
"test": "react-scripts test --env=jsdom", "test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject", "eject": "react-scripts eject",
"build_prod": "NODE_ENV=production NODE_OPTIONS=--max_old_space_size=4096 webpack -p --display errors-only --hide-modules", "build_prod": "cross-env 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_dev": "cross-env NODE_ENV=development webpack -d --watch ",
"server": "node-env-run server --exec nodemon | pino-colada", "server": "node-env-run server --exec nodemon | pino-colada",
"dev2": "run-p server start", "dev2": "run-p server start",
"lint": "eslint \"src/**/*.js\"" "lint": "eslint \"src/**/*.js\""

@ -44,6 +44,7 @@
"babel-loader": "^8.0.6", "babel-loader": "^8.0.6",
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
"chai": "^4.1.2", "chai": "^4.1.2",
"cross-env": "^7.0.0",
"css-loader": "^0.28.11", "css-loader": "^0.28.11",
"eslint": "^5.16.0", "eslint": "^5.16.0",
"eslint-config-prettier": "4.3.0", "eslint-config-prettier": "4.3.0",
@ -87,8 +88,8 @@
"watch": "webpack --watch --mode development", "watch": "webpack --watch --mode development",
"test": "react-scripts test --env=jsdom", "test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject", "eject": "react-scripts eject",
"build_prod": "NODE_ENV=production NODE_OPTIONS=--max_old_space_size=4096 webpack -p --display errors-only --hide-modules", "build_prod": "cross-env 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_dev": "cross-env NODE_ENV=development webpack -d --watch ",
"server": "node-env-run server --exec nodemon | pino-colada", "server": "node-env-run server --exec nodemon | pino-colada",
"dev2": "run-p server start", "dev2": "run-p server start",
"lint": "eslint \"src/**/*.js\"" "lint": "eslint \"src/**/*.js\""

@ -47,6 +47,7 @@
"babel-loader": "^8.0.6", "babel-loader": "^8.0.6",
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
"chai": "^4.1.2", "chai": "^4.1.2",
"cross-env": "^7.0.0",
"css-loader": "^0.28.11", "css-loader": "^0.28.11",
"eslint": "^5.16.0", "eslint": "^5.16.0",
"eslint-config-prettier": "4.3.0", "eslint-config-prettier": "4.3.0",
@ -91,8 +92,8 @@
"watch": "webpack --watch --mode development", "watch": "webpack --watch --mode development",
"test": "react-scripts test --env=jsdom", "test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject", "eject": "react-scripts eject",
"build_prod": "NODE_ENV=production NODE_OPTIONS=--max_old_space_size=4096 webpack -p --display errors-only --hide-modules", "build_prod": "cross-env 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_dev": "cross-env NODE_ENV=development webpack -d --watch ",
"server": "node-env-run server --exec nodemon | pino-colada", "server": "node-env-run server --exec nodemon | pino-colada",
"dev2": "run-p server start", "dev2": "run-p server start",
"lint": "eslint \"src/**/*.js\"" "lint": "eslint \"src/**/*.js\""

@ -156,7 +156,7 @@ public class DeviceDetailsDAOImpl implements DeviceDetailsDAO {
Connection conn; Connection conn;
PreparedStatement stmt = null; PreparedStatement stmt = null;
ResultSet rs = null; ResultSet rs = null;
DeviceInfo deviceInfo = null; DeviceInfo deviceInfo = new DeviceInfo();
try { try {
conn = this.getConnection(); conn = this.getConnection();
@ -167,7 +167,6 @@ public class DeviceDetailsDAOImpl implements DeviceDetailsDAO {
rs = stmt.executeQuery(); rs = stmt.executeQuery();
if (rs.next()) { if (rs.next()) {
deviceInfo = new DeviceInfo();
// deviceInfo.setIMEI(rs.getString("IMEI")); // deviceInfo.setIMEI(rs.getString("IMEI"));
// deviceInfo.setIMSI(rs.getString("IMSI")); // deviceInfo.setIMSI(rs.getString("IMSI"));
deviceInfo.setDeviceModel(rs.getString("DEVICE_MODEL")); deviceInfo.setDeviceModel(rs.getString("DEVICE_MODEL"));

Loading…
Cancel
Save