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

implemented PO's Requested changes

parent e9129acb
No related branches found
No related tags found
1 merge request!16Ready to merge - Database
//Holds users data repository
package Team5.SmartTowns.Data;
import java.util.List;
......
//Implements the users repository using JDBC
package Team5.SmartTowns.Data;
import org.springframework.jdbc.core.JdbcTemplate;
......@@ -20,7 +21,7 @@ public class UserRepositoryJDBC implements UserRepository{
private void setuserMapper(){
userMapper = (rs, i) -> new user(
rs.getInt("userId"),
rs.getInt("userID"),
rs.getString("name")
);
}
......
//Holds variable data for the locations table
package Team5.SmartTowns.Data;
import lombok.AllArgsConstructor;
......
//Holds locations data repository
package Team5.SmartTowns.Data;
import java.util.List;
......
//Implements the locations repository using JDBC
package Team5.SmartTowns.Data;
import org.springframework.jdbc.core.JdbcTemplate;
......
//Holds variable data for the trails table
package Team5.SmartTowns.Data;
import lombok.AllArgsConstructor;
......
//Holds trails data repository
package Team5.SmartTowns.Data;
import java.util.List;
......
//Implements the trails repository using JDBC
package Team5.SmartTowns.Data;
import org.springframework.jdbc.core.JdbcTemplate;
......@@ -10,7 +11,7 @@ import java.util.List;
public class trailsRepositoryJDBC implements trailsRepository{
private JdbcTemplate jdbc;
private RowMapper<trail> trailMapper;
public trailsRepositoryJDBC(JdbcTemplate aJdbc){
public trailsRepositoryJDBC(JdbcTemplate aJdbc){
this.jdbc = aJdbc;
settrailsMapper();
}
......
//Holds variable data for the users table
package Team5.SmartTowns.Data;
import lombok.AllArgsConstructor;
......@@ -7,8 +8,5 @@ import lombok.Data;
@AllArgsConstructor
public class user {
private int userId;
// private String title;
private String name;
// private String lastName;
// private String emailAddress;
}
drop table if exists trail;
create table if not exists trail
(
trailID bigint auto_increment primary key,
name varchar
) engine=InnoDB;
drop table if exists locations;
create table if not exists locations
(
locationID bigint auto_increment primary key,
name varchar
) engine=InnoDB;
drop table if exists users;
create table if not exists users
(
userID bigint auto_increment primary key,
name varchar
) engine=InnoDB;
\ No newline at end of file
drop table if exists trails;
create table if not exists trails
(
trailID bigint auto_increment primary key,
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)
) engine=InnoDB;
drop table if exists users;
create table if not exists users
(
userID bigint auto_increment primary key,
name varchar(128)
) engine=InnoDB;
\ No newline at end of file
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