From 3091d8eb63a320a0180f8f0cd11803b68b2692c7 Mon Sep 17 00:00:00 2001 From: Liam Beckett Date: Sat, 24 Sep 2016 17:24:59 +1200 Subject: [PATCH] Fixed Some Dictionary Errors in Flightpoints --- src/main/java/seng202/group9/Controller/Dataset.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/seng202/group9/Controller/Dataset.java b/src/main/java/seng202/group9/Controller/Dataset.java index 8dbf035..f94ffdc 100644 --- a/src/main/java/seng202/group9/Controller/Dataset.java +++ b/src/main/java/seng202/group9/Controller/Dataset.java @@ -51,6 +51,7 @@ public class Dataset { this.countryDictionary = new LinkedHashMap();; this.cityDictionary = new LinkedHashMap();; this.flightPathDictionary = new LinkedHashMap(); + this.flightPointDictionary = new LinkedHashMap(); if (action == getExisting){ updateDataset(); //after this make connections. ie filling in the country.cities airports.routes etc @@ -711,17 +712,19 @@ public class Dataset { insertFlightPointQuery += ","; } insertFlightPointQuery += "(" + flightPathId +", \""+ flightName +"\", \"" + flightType + "\", "+ flightAltitude + ", " + - "" + flightLatitude + ", " + flightLongitude + ", "+numOfFlights+")"; + "" + flightLatitude + ", " + flightLongitude + ")"; flightPointsToImport.get(i).setID(nextID); flightPointsToImport.get(i).setIndexID(flightPathId); //add data to dataset array. //this is placed after incase the database messes up flightPathToAdd.addFlightPoint(flightPointsToImport.get(i)); //routeDictionary.put(routeIdentifier, flightsToImport.get(i)); + flightPointDictionary.put(nextID, flightPointsToImport.get(i)); nextID++; numOfFlights++; //} } + System.out.println(insertFlightPointQuery); if (numOfFlights > 0){ stmt.execute(insertFlightPointQuery); }