Adding temporary development code bits for dashboard analytics feature

revert-70aa11f8
dilanua 9 years ago
parent f200f37c80
commit f2f153a2b4

@ -485,7 +485,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 {
@ -523,7 +522,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"));
@ -612,7 +613,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();
@ -644,7 +644,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