Skip to content
Snippets Groups Projects
Commit 0cd3080c authored by Byron Biggs's avatar Byron Biggs
Browse files

"Corrected type sensitivity throughout project"

parent bd2a8f1e
No related branches found
No related tags found
No related merge requests found
......@@ -31,33 +31,33 @@ public class contactRepositoryImpl {
};
public void addContactItem(Contact contact) {
String sql = "INSERT INTO emaildata (Email, Query) VALUES (?, ?)";
String sql = "INSERT INTO emailData (Email, Query) VALUES (?, ?)";
jdbcTemplate.update(sql, contact.getEmail(), contact.getQuery());
}
public List<Contact> getContactItems() {
String sql = "SELECT * FROM emaildata";
String sql = "SELECT * FROM emailData";
return jdbcTemplate.query(sql, contactRowMapper);
}
public void addPhoneNumber(PhoneNumber phoneNumber) {
String sql = "INSERT INTO phonenumberdata (phoneNumber) VALUES (?)";
String sql = "INSERT INTO phoneNumberData (phoneNumber) VALUES (?)";
jdbcTemplate.update(sql, phoneNumber.getPhoneNumber());
}
public List<PhoneNumber> getPhoneNumbers() {
String sql = "SELECT * FROM phonenumberdata";
String sql = "SELECT * FROM phoneNumberData";
return jdbcTemplate.query(sql, phoneRowMapper);
}
// Delete methods by ID
public void deleteContactItem(Long id) {
String sql = "DELETE FROM emaildata WHERE ID = ?";
String sql = "DELETE FROM emailData WHERE ID = ?";
jdbcTemplate.update(sql, id);
}
public void deletePhoneNumber(Long id) {
String sql = "DELETE FROM phonenumberdata WHERE ID = ?";
String sql = "DELETE FROM phoneNumberData WHERE ID = ?";
jdbcTemplate.update(sql, id);
}
}
......
create database if not exists ludek;
use ludek;
create table if not exists media(
post_id int auto_increment primary key,
title varchar(255) not null,
description text,
archived boolean default false
);
create table if not exists media_files(
file_id int auto_increment primary key,
post_id int not null,
media_type ENUM('IMAGE', 'VIDEO') not null,
file_path varchar(512) not null,
foreign key (post_id) references media(post_id) on delete cascade
);
......@@ -2,7 +2,7 @@ drop database if exists ludek;
create database if not exists ludek;
use ludek;
create table emaildata
create table emailData
(
ID int auto_increment
primary key,
......@@ -46,7 +46,7 @@ create table news_articles
archived tinyint(1) default 0 null
);
create table phonenumberdata
create table phoneNumberData
(
ID int auto_increment
primary key,
......@@ -110,12 +110,12 @@ create index role_id
on user_roles (role_id);
-- Single sample for emaildata
INSERT INTO emaildata (Email, Query)
-- Single sample for emailData
INSERT INTO emailData (Email, Query)
VALUES ('contact@example.com', 'Sample inquiry about community events');
-- Single sample for phonenumberdata
INSERT INTO phonenumberdata (phoneNumber)
-- Single sample for phoneNumberData
INSERT INTO phoneNumberData (phoneNumber)
VALUES ('07712345678');
-- Single sample for news_articles
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment