1
0
forked from PGL/Clyde

- Changement des noms de variables

- Ajout des getters/setters appropriés
- Ajout des constructeur nécessaires
This commit is contained in:
LeoMoulin 2024-03-03 17:42:26 +01:00
parent bbe1f9767c
commit 684c3095eb
8 changed files with 232 additions and 45 deletions

0
.attach_pid7200 Normal file
View File

View File

@ -9,8 +9,44 @@ import jakarta.persistence.Id;
public class Course { public class Course {
@Id @Id
@GeneratedValue(strategy = GenerationType.AUTO) @GeneratedValue(strategy = GenerationType.AUTO)
private int CourseID; private int courseID;
private int Credits; private int credits;
private String Title; private String title;
private String Faculty; 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;
}
} }

View File

@ -9,8 +9,35 @@ import jakarta.persistence.Id;
public class Cursus { public class Cursus {
@Id @Id
@GeneratedValue(strategy = GenerationType.AUTO) @GeneratedValue(strategy = GenerationType.AUTO)
private int CursusId; private int cursusId;
private int Year; private int year;
private String Option; 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;
}
} }

View File

@ -10,7 +10,33 @@ public class CursusCourse {
@Id @Id
@GeneratedValue(strategy = GenerationType.AUTO) @GeneratedValue(strategy = GenerationType.AUTO)
private int id; private int id;
private int CursusId; private int cursusId;
private int CourseId; 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;
}
} }

View File

@ -10,6 +10,33 @@ public class Secretary {
@Id @Id
@GeneratedValue(strategy = GenerationType.AUTO) @GeneratedValue(strategy = GenerationType.AUTO)
private int id; private int id;
private int RegNo; private int regNo;
private String Faculty; 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;
}
} }

View File

@ -10,7 +10,45 @@ public class TeacherGivenCourse {
@Id @Id
@GeneratedValue(strategy = GenerationType.AUTO) @GeneratedValue(strategy = GenerationType.AUTO)
private int id; private int id;
private int RegNo; private int regNo;
private int CourseId; private int courseId;
private boolean Owned;
//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;
}
} }

View File

@ -13,78 +13,84 @@ import java.util.Date;
public class User { public class User {
@Id @Id
@GeneratedValue(strategy = GenerationType.AUTO) @GeneratedValue(strategy = GenerationType.AUTO)
private int RegNo; private int regNo;
private String LastName; private String lastName;
private String FirstName; private String firstName;
private String Email; private String email;
private String Adress; private String adress;
private String Country; private String country;
private Date BirthDate; private Date birthDate;
private ovh.herisson.Clyde.Tables.Role Role; private ovh.herisson.Clyde.Tables.Role role;
private String Password; private String password;
public User(String LastName, String FirstName){ public User(String lastName, String firstName, String email, String adress, String country, Date birthDate, Role role){
this.LastName = LastName; this.lastName = lastName;
this.FirstName = FirstName; 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() { public String getLastName() {
return LastName; return lastName;
} }
public void setLastName(String LastName) { public void setLastName(String lastName) {
this.LastName = LastName; this.lastName = lastName;
} }
public String getFirstName() { public String getFirstName() {
return FirstName; return firstName;
} }
public void setFirstName(String firstName) { public void setFirstName(String firstName) {
FirstName = firstName; this.firstName = firstName;
} }
public String getEmail() { public String getEmail() {
return Email; return email;
} }
public void setEmail(String email) { public void setEmail(String email) {
Email = email; this.email = email;
} }
public String getAdress() { public String getAdress() {
return Adress; return adress;
} }
public void setAdress(String adress) { public void setAdress(String adress) {
Adress = adress; this.adress = adress;
} }
public String getCountry() { public String getCountry() {
return Country; return country;
} }
public void setCountry(String country) { public void setCountry(String country) {
Country = country; this.country = country;
} }
public Date getBirthDate() { public Date getBirthDate() {
return BirthDate; return birthDate;
} }
public void setBirthDate(Date birthDate) { public void setBirthDate(Date birthDate) {
BirthDate = birthDate; this.birthDate = birthDate;
} }
public ovh.herisson.Clyde.Tables.Role getRole() { public ovh.herisson.Clyde.Tables.Role getRole() {
return Role; return role;
} }
public void setRole(ovh.herisson.Clyde.Tables.Role role) { public void setRole(ovh.herisson.Clyde.Tables.Role role) {
Role = role; this.role = role;
} }
} }

View File

@ -8,6 +8,33 @@ public class UserCursus {
@Id @Id
@GeneratedValue(strategy = GenerationType.AUTO) @GeneratedValue(strategy = GenerationType.AUTO)
private int id; private int id;
private int RegNo; private int regNo;
private int CursusId; 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;
}
} }