Skip to content
Snippets Groups Projects
Commit 49e762e6 authored by Rhys Evans's avatar Rhys Evans
Browse files

commiting changes

parent 5d2bbcf4
No related branches found
No related tags found
1 merge request!40Resolve "As a user I would like to see a map containing all landmarks for a trail and a suggested path between them, so that I can easily follow the trail"
......@@ -9,11 +9,11 @@ public interface LocationRepository {
void addLocation(Location loc);
List<Location> getApprovedLocations();
List<Location> getAllApprovedLocations();
// List<Location> getApprovedLocations2(List<Location> list);
List<Location> getUnapprovedLocations();
List<Location> getAllUnapprovedLocations();
// List<Location> approvedLocations();
......
......@@ -52,8 +52,8 @@ public class LocationRepositoryJDBC implements LocationRepository {
// this.locationMapper = locationMapper;
// }
public List<Location> getAllApprovedLocation(){
@Override
public List<Location> getAllApprovedLocations(){
String sql= "SELECT * FROM locations";
List<Location> lis = jdbc.query(sql, locationMapper);
List<Location> lisFiltered = new ArrayList<>();
......@@ -65,8 +65,8 @@ public class LocationRepositoryJDBC implements LocationRepository {
return lisFiltered;
}
public List<Location> getAllUnapprovedLocation(){
@Override
public List<Location> getAllUnapprovedLocations(){
String sql= "SELECT * FROM locations";
List<Location> lis = jdbc.query(sql, locationMapper);
List<Location> lisFiltered = new ArrayList<>();
......@@ -85,17 +85,17 @@ public class LocationRepositoryJDBC implements LocationRepository {
jdbc.update(sql,loc.getLocationName(),loc.getLocationEmail(),loc.getLocationDescription(),loc.getLocationPlace(),loc.getLocationTrailID(), false);
}
@Override
public List<Location> getApprovedLocations(){
JdbcTemplate jdbc = new JdbcTemplate();
List<Location> locations = new LocationRepositoryJDBC(jdbc).getAllLocation();
List<Location> locationApprovalList= new ArrayList<Location>();
for (Location loc :locations){
if (loc.isLocationApproved()) {
locationApprovalList.add(loc);
}
} return locationApprovalList;
}
// @Override
// public List<Location> getApprovedLocations(){
// JdbcTemplate jdbc = new JdbcTemplate();
// List<Location> locations = new LocationRepositoryJDBC(jdbc).getAllLocation();
// List<Location> locationApprovalList= new ArrayList<Location>();
// for (Location loc :locations){
// if (loc.isLocationApproved()) {
// locationApprovalList.add(loc);
// }
// } return locationApprovalList;
// }
//
// @Override
// public List<Location> getApprovedLocations2(List<Location> list){
......@@ -110,16 +110,16 @@ public class LocationRepositoryJDBC implements LocationRepository {
//
@Override
public List<Location> getUnapprovedLocations(){
List<Location> locations = getAllLocation();
List<Location> locationUnapprovedList= new ArrayList<Location>();
for (Location loc :locations){
if (!loc.isLocationApproved()) {
locationUnapprovedList.add(loc);
}
} return locationUnapprovedList;
}
// @Override
// public List<Location> getUnapprovedLocations(){
// List<Location> locations = getAllLocation();
// List<Location> locationUnapprovedList= new ArrayList<Location>();
// for (Location loc :locations){
// if (!loc.isLocationApproved()) {
// locationUnapprovedList.add(loc);
// }
// } return locationUnapprovedList;
// }
// public JdbcTemplate getJdbc() {
......
......@@ -92,11 +92,11 @@ public class LocationsCoordinates {
// JdbcTemplate jdbcSuper= new LocationRepositoryJDBC().getJdbc();
// return new LocationRepositoryJDBC(jdbcSuper).getApprovedLocations();
// }
public List<Location> getFullUnapprovedLocations(JdbcTemplate aJdbc){
// LocationsCoordinates jdbcSuper= new LocationsCoordinates(aJdbc);
return new LocationRepositoryJDBC(aJdbc).getUnapprovedLocations();
}
//
// public List<Location> getFullUnapprovedLocations(JdbcTemplate aJdbc){
//// LocationsCoordinates jdbcSuper= new LocationsCoordinates(aJdbc);
// return new LocationRepositoryJDBC(aJdbc).getUnapprovedLocations();
// }
......
......@@ -13,7 +13,7 @@ public interface PlacesCoordinatesRepository {
List<TownWithTrails> getAllTownCoords();
void addTownWithCoords(TownWithTrails town);
List<Location> getFullApprovedLocations(JdbcTemplate aJdbc);
// List<Location> getFullApprovedLocations(JdbcTemplate aJdbc);
......
......@@ -77,10 +77,10 @@ public class PlacesCoordinatesRepositoryJDBC implements PlacesCoordinatesReposit
}
public List<Location> getFullApprovedLocations(JdbcTemplate aJdbc) {
// LocationsCoordinates jdbcSuper= new LocationsCoordinates(aJdbc);
return new LocationRepositoryJDBC(aJdbc).getApprovedLocations();
}
// public List<Location> getFullApprovedLocations(JdbcTemplate aJdbc) {
//// LocationsCoordinates jdbcSuper= new LocationsCoordinates(aJdbc);
// return new LocationRepositoryJDBC(aJdbc).getApprovedLocations();
// }
// @Override //TODO CHECK
// public List<Location> getFullApprovedLocations(JdbcTemplate aJdbc) {
......
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