Skip to content
Snippets Groups Projects
Commit 170793d3 authored by Martin Slovík's avatar Martin Slovík
Browse files

Remove GpsLocation from DatabaseInitializer

parent 2aa4b4c5
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -102,13 +102,13 @@ public class DatabaseInitializer { ...@@ -102,13 +102,13 @@ public class DatabaseInitializer {
paris.setCountry(france); paris.setCountry(france);
cityRepository.save(paris); cityRepository.save(paris);
var ber = createAirport("Berlin Brandenburg Airport", "BER", new GpsLocation(52.3666666667, 13.5033333333)); var ber = createAirport("Berlin Brandenburg Airport", "BER", 52.3666666667, 13.5033333333);
ber.setCity(berlin); ber.setCity(berlin);
airportRepository.save(ber); airportRepository.save(ber);
flight1.setDepartingAirport(ber); flight1.setDepartingAirport(ber);
flightRepository.save(flight1); flightRepository.save(flight1);
var cdg = createAirport("Paris Charles de Gaulle airport", "CDG", new GpsLocation(49.0083899664, 2.53844117956)); var cdg = createAirport("Paris Charles de Gaulle airport", "CDG", 49.0083899664, 2.53844117956);
cdg.setCity(paris); cdg.setCity(paris);
airportRepository.save(cdg); airportRepository.save(cdg);
flight1.setArrivingAirport(cdg); flight1.setArrivingAirport(cdg);
...@@ -163,11 +163,12 @@ public class DatabaseInitializer { ...@@ -163,11 +163,12 @@ public class DatabaseInitializer {
return flightSteward; return flightSteward;
} }
private Airport createAirport(String name, String code, GpsLocation gpsLocation) { private Airport createAirport(String name, String code, double latitude, double longitude) {
var airport = new Airport(); var airport = new Airport();
airport.setName(name); airport.setName(name);
airport.setCode(code); airport.setCode(code);
airport.setGpsLocation(gpsLocation); airport.setLatitude(latitude);
airport.setLongitude(longitude);
return airport; return airport;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment