Adding temporary development code bits for dashboard analytics feature

4.x.x
dilanua 9 years ago
parent 49513ba79b
commit 46117b4e84

@ -411,7 +411,6 @@ class GadgetDataServiceDAOImpl implements GadgetDataServiceDAO {
PreparedStatement stmt = null; PreparedStatement stmt = null;
ResultSet rs = null; ResultSet rs = null;
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
Map<String, Object> filteredDeviceWithDetails = new HashMap<>();
List<Map<String, Object>> filteredDevicesWithDetails = new ArrayList<>(); List<Map<String, Object>> filteredDevicesWithDetails = new ArrayList<>();
int totalRecordsCount = 0; int totalRecordsCount = 0;
try { try {
@ -448,7 +447,9 @@ class GadgetDataServiceDAOImpl implements GadgetDataServiceDAO {
// executing query // executing query
rs = stmt.executeQuery(); rs = stmt.executeQuery();
// fetching query results // fetching query results
Map<String, Object> filteredDeviceWithDetails;
while (rs.next()) { while (rs.next()) {
filteredDeviceWithDetails = new HashMap<>();
filteredDeviceWithDetails.put("device-id", rs.getInt("DEVICE_ID")); filteredDeviceWithDetails.put("device-id", rs.getInt("DEVICE_ID"));
filteredDeviceWithDetails.put("platform", rs.getString("PLATFORM")); filteredDeviceWithDetails.put("platform", rs.getString("PLATFORM"));
filteredDeviceWithDetails.put("ownership", rs.getString("OWNERSHIP")); filteredDeviceWithDetails.put("ownership", rs.getString("OWNERSHIP"));
@ -559,7 +560,6 @@ class GadgetDataServiceDAOImpl implements GadgetDataServiceDAO {
PreparedStatement stmt = null; PreparedStatement stmt = null;
ResultSet rs = null; ResultSet rs = null;
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
Map<String, Object> filteredDeviceWithDetails = new HashMap<>();
List<Map<String, Object>> filteredDevicesWithDetails = new ArrayList<>(); List<Map<String, Object>> filteredDevicesWithDetails = new ArrayList<>();
try { try {
con = this.getConnection(); con = this.getConnection();
@ -589,7 +589,9 @@ class GadgetDataServiceDAOImpl implements GadgetDataServiceDAO {
// executing query // executing query
rs = stmt.executeQuery(); rs = stmt.executeQuery();
// fetching query results // fetching query results
Map<String, Object> filteredDeviceWithDetails;
while (rs.next()) { while (rs.next()) {
filteredDeviceWithDetails = new HashMap<>();
filteredDeviceWithDetails.put("device-id", rs.getInt("DEVICE_ID")); filteredDeviceWithDetails.put("device-id", rs.getInt("DEVICE_ID"));
filteredDeviceWithDetails.put("platform", rs.getString("PLATFORM")); filteredDeviceWithDetails.put("platform", rs.getString("PLATFORM"));
filteredDeviceWithDetails.put("ownership", rs.getString("OWNERSHIP")); filteredDeviceWithDetails.put("ownership", rs.getString("OWNERSHIP"));

Loading…
Cancel
Save