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

Updated table to contain correct table columns with partial Caerphilly...

 Updated table to contain correct table columns with partial Caerphilly location data frome ach avialable trail
parent d0df041c
No related branches found
No related tags found
1 merge request!23Resolve "As a developer I want all landmarks to be stored together"
//Holds variable data for the locations table
//Holds variable data for the locations table (landmarks)
package Team5.SmartTowns.Data;
import lombok.AllArgsConstructor;
import lombok.Data;
//insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace,
// locationTrailID
// ) value ('1', 'St Cenydd','','location description here','Caerphilly',0101);
@Data
@AllArgsConstructor
public class location {
private int locationID;
private String name;
private String locationName;
private String locationEmail;
private String locationDescription;
private String locationPlace;
private int locationTrailID;
}
//Holds locations data repository
//Holds locations data repository (landmarks)
package Team5.SmartTowns.Data;
import java.util.List;
public interface locationRepository {
List<location> getAllLocation();
......
......@@ -19,7 +19,11 @@ public class locationRepositoryJDBC implements locationRepository {
private void setlocationMapper(){
locationMapper = (rs, i) -> new location(
rs.getInt("locationID"),
rs.getString("name")
rs.getString("locationName"),
rs.getString("locationEmail"),
rs.getString("locationDescription"),
rs.getString("locationPlace"),
rs.getInt("locationTrailID")
);
}
public List<location> getAllLocation(){
......
......@@ -7,5 +7,35 @@ insert into trails (trailID, Name) value ('1', 'Caerphilly Coffee Trail');
insert into trails (trailID, Name) value ('2', 'Penarth Dragon Trail');
delete from locations;
insert into locations (locationID, Name) value ('1', 'Caerphilly');
insert into locations (locationID, Name) value ('2', 'Penarth');
\ No newline at end of file
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ('1', 'St Cenydd','','location description here','Caerphilly',0101);
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ('2', 'The Castle','','location description here','Caerphilly',0101);
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ('3', 'Medieval Trades','','location description here','Caerphilly',0101);
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ('4', 'The Queen''s War','','location description here','Caerphilly',0101);
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ('5', 'The Green Lady','','location description here','Caerphilly',0101);
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ('6', 'Armoury','','location description here','Caerphilly',0101);
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ('7', 'Architecture','','location description here','Caerphilly',0101);
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ('8', '21st Century Landmark','','location description here','Caerphilly',0101);
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ('9', 'JD Wetherspoons-Malcolm Uphill','','location description here','Caerphilly',0102);
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ('10', 'Caerphilly Cwtch','','location description here','Caerphilly',0102);
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ('11', 'Caerphilly Conservative Club','','location description here','Caerphilly',0102);
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ('12', 'The King''s Arms','','location description here','Caerphilly',0102);
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ('13', 'Caerphilly Bus Station','','location description here','Caerphilly',0103);
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ('14', 'The Medieval Courthouse','','location description here','Caerphilly',0103);
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ('15', 'Caerphilly Castle','','location description here','Caerphilly',0103);
insert into locations (locationID, locationName , locationEmail,locationDescription,locationPlace, locationTrailID) value ('16', 'Ty Vaughan House','','location description here','Caerphilly',0103);
#
# locationID bigint auto_increment primary key,
# locationName varchar(128),
# locationEmail varchar(128),
# locationDescription varchar(255),
# locationTrailID varchar(128)
#
#
# <option value=0 disabled selected>Select Trail</option>
# <option value=0101>(Caerphilly) Castle Trail</option>
# <option value=0102>(Caerphilly) Pub Trail</option>
# <option value=0103>(Caerphilly) Heritage Trail</option>
# <option value=0201>(Risca) Heritage and Culture Trail</option>
# <option value=0301>(Penarth) Esplanade Trail</option>
\ No newline at end of file
......@@ -5,10 +5,15 @@ create table if not exists trails
name varchar(128)
) engine=InnoDB;
drop table if exists locations;
create table if not exists locations
(
locationID bigint auto_increment primary key,
name varchar(128)
locationName varchar(128),
locationEmail varchar(128),
locationDescription varchar(255),
locationPlace varchar(255),
locationTrailID varchar(128)
) engine=InnoDB;
drop table if exists users;
create table if not exists users
......
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