From 684c3095eb7b4e9297d29a85f9648abe3e7d8d9b Mon Sep 17 00:00:00 2001 From: LeoMoulin Date: Sun, 3 Mar 2024 17:42:26 +0100 Subject: [PATCH] =?UTF-8?q?-=20Changement=20des=20noms=20de=20variables=20?= =?UTF-8?q?-=20Ajout=20des=20getters/setters=20appropri=C3=A9s=20-=20Ajout?= =?UTF-8?q?=20des=20constructeur=20n=C3=A9cessaires?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .attach_pid7200 | 0 .../ovh/herisson/Clyde/Tables/Course.java | 44 +++++++++++-- .../ovh/herisson/Clyde/Tables/Cursus.java | 33 +++++++++- .../herisson/Clyde/Tables/CursusCourse.java | 30 ++++++++- .../ovh/herisson/Clyde/Tables/Secretary.java | 31 ++++++++- .../Clyde/Tables/TeacherGivenCourse.java | 44 ++++++++++++- .../java/ovh/herisson/Clyde/Tables/User.java | 64 ++++++++++--------- .../ovh/herisson/Clyde/Tables/UserCursus.java | 31 ++++++++- 8 files changed, 232 insertions(+), 45 deletions(-) create mode 100644 .attach_pid7200 diff --git a/.attach_pid7200 b/.attach_pid7200 new file mode 100644 index 0000000..e69de29 diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/Course.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/Course.java index b5bdf00..54e167a 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Tables/Course.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/Course.java @@ -9,8 +9,44 @@ import jakarta.persistence.Id; public class Course { @Id @GeneratedValue(strategy = GenerationType.AUTO) - private int CourseID; - private int Credits; - private String Title; - private String Faculty; + private int courseID; + private int credits; + private String title; + private String faculty; + + public Course(int credits, String title, String faculty){ + this.credits = credits; + this.title = title; + this.faculty = faculty; + } + + public Course() {} + + public int getCourseID() { + return courseID; + } + + public int getCredits() { + return credits; + } + + public void setCredits(int credits){ + this.credits = credits; + } + + public String getFaculty() { + return faculty; + } + + public void setFaculty(String faculty){ + this.faculty = faculty; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title){ + this.title = title; + } } diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/Cursus.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/Cursus.java index c909f9e..5167197 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Tables/Cursus.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/Cursus.java @@ -9,8 +9,35 @@ import jakarta.persistence.Id; public class Cursus { @Id @GeneratedValue(strategy = GenerationType.AUTO) - private int CursusId; - private int Year; - private String Option; + private int cursusId; + private int year; + private String option; + + public Cursus(int year, String option){ + this.year = year; + this.option = option; + } + + public Cursus() {} + + public int getCursusId(){ + return this.cursusId; + } + + public int getYear(){ + return this.year; + } + + public void setYear(int year){ + this.year = year; + } + + public String getOption(){ + return this.option; + } + + public void setOption(String option){ + this.option = option; + } } diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/CursusCourse.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/CursusCourse.java index c8a669f..30fed1c 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Tables/CursusCourse.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/CursusCourse.java @@ -10,7 +10,33 @@ public class CursusCourse { @Id @GeneratedValue(strategy = GenerationType.AUTO) private int id; - private int CursusId; - private int CourseId; + private int cursusId; + private int courseId; + public CursusCourse(int cursusId, int courseId){ + this.cursusId = cursusId; + this.courseId = courseId; + } + + public CursusCourse() {} + + public int getId() { + return id; + } + + public int getCourseId() { + return courseId; + } + + public void setCourseId(int courseId){ + this.courseId = courseId; + } + + public int getCursusId() { + return cursusId; + } + + public void setCursusId(int cursusId) { + this.cursusId = cursusId; + } } diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/Secretary.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/Secretary.java index 8c2220b..ec7a86a 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Tables/Secretary.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/Secretary.java @@ -10,6 +10,33 @@ public class Secretary { @Id @GeneratedValue(strategy = GenerationType.AUTO) private int id; - private int RegNo; - private String Faculty; + private int regNo; + private String faculty; + + public Secretary(int regNo, String faculty){ + this.regNo = regNo; + this.faculty = faculty; + } + + public Secretary() {} + + public int getId() { + return id; + } + + public int getRegNo() { + return regNo; + } + + public void setRegNo(int regNo) { + this.regNo = regNo; + } + + public String getFaculty() { + return faculty; + } + + public void setFaculty(String faculty) { + this.faculty = faculty; + } } diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/TeacherGivenCourse.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/TeacherGivenCourse.java index 5dcf1bf..6e137c5 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Tables/TeacherGivenCourse.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/TeacherGivenCourse.java @@ -10,7 +10,45 @@ public class TeacherGivenCourse { @Id @GeneratedValue(strategy = GenerationType.AUTO) private int id; - private int RegNo; - private int CourseId; - private boolean Owned; + private int regNo; + private int courseId; + + //This flag helps make the difference between an assistant or a Teacher (who owns the course) + private boolean owned; + + public TeacherGivenCourse(int regNo, int courseId, boolean owned){ + this.regNo = regNo; + this.courseId = courseId; + this.owned = owned; + } + + public TeacherGivenCourse() {} + + public int getId() { + return id; + } + + public int getRegNo() { + return regNo; + } + + public void setRegNo(int regNo) { + this.regNo = regNo; + } + + public int getCourseId() { + return courseId; + } + + public void setCourseId(int courseId) { + this.courseId = courseId; + } + + public boolean isOwned() { + return owned; + } + + public void setOwned(boolean owned) { + this.owned = owned; + } } diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/User.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/User.java index 2165681..172fd0d 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Tables/User.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/User.java @@ -13,78 +13,84 @@ import java.util.Date; public class User { @Id @GeneratedValue(strategy = GenerationType.AUTO) - private int RegNo; - private String LastName; - private String FirstName; - private String Email; - private String Adress; - private String Country; - private Date BirthDate; - private ovh.herisson.Clyde.Tables.Role Role; - private String Password; + private int regNo; + private String lastName; + private String firstName; + private String email; + private String adress; + private String country; + private Date birthDate; + private ovh.herisson.Clyde.Tables.Role role; + private String password; - public User(String LastName, String FirstName){ - this.LastName = LastName; - this.FirstName = FirstName; + public User(String lastName, String firstName, String email, String adress, String country, Date birthDate, Role role){ + this.lastName = lastName; + this.firstName = firstName; + this.email = email; + this.adress = adress; + this.country = country; + this.birthDate = birthDate; + this.role = role; } - public User() { + public User() {} + public int getRegNo(){ + return this.regNo; } - public String getLastName() { - return LastName; + return lastName; } - public void setLastName(String LastName) { - this.LastName = LastName; + public void setLastName(String lastName) { + this.lastName = lastName; } public String getFirstName() { - return FirstName; + return firstName; } public void setFirstName(String firstName) { - FirstName = firstName; + this.firstName = firstName; } public String getEmail() { - return Email; + return email; } public void setEmail(String email) { - Email = email; + this.email = email; } public String getAdress() { - return Adress; + return adress; } public void setAdress(String adress) { - Adress = adress; + this.adress = adress; } public String getCountry() { - return Country; + return country; } public void setCountry(String country) { - Country = country; + this.country = country; } public Date getBirthDate() { - return BirthDate; + return birthDate; } public void setBirthDate(Date birthDate) { - BirthDate = birthDate; + this.birthDate = birthDate; } public ovh.herisson.Clyde.Tables.Role getRole() { - return Role; + return role; } public void setRole(ovh.herisson.Clyde.Tables.Role role) { - Role = role; + this.role = role; } } diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/UserCursus.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/UserCursus.java index d638198..2222fdb 100644 --- a/backend/src/main/java/ovh/herisson/Clyde/Tables/UserCursus.java +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/UserCursus.java @@ -8,6 +8,33 @@ public class UserCursus { @Id @GeneratedValue(strategy = GenerationType.AUTO) private int id; - private int RegNo; - private int CursusId; + private int regNo; + private int cursusId; + + public UserCursus(int regNo, int cursusId){ + this.regNo = regNo; + this.cursusId = cursusId; + } + + public UserCursus() {} + + public int getId() { + return id; + } + + public int getRegNo() { + return regNo; + } + + public void setRegNo(int regNo) { + this.regNo = regNo; + } + + public int getCursusId() { + return cursusId; + } + + public void setCursusId(int cursusId) { + this.cursusId = cursusId; + } }