Compare commits
No commits in common. "3b31fa794fc0f87329e2eaed36dc0dcb0a806003" and "2f2a72bfa0b4f74ca45b17b79150b171160f8764" have entirely different histories.
3b31fa794f
...
2f2a72bfa0
@ -8,17 +8,15 @@ public class CursusCourse {
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private int id;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "Cursus")
|
||||
private Cursus cursus;
|
||||
private int cursusId;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "Course")
|
||||
private Course course;
|
||||
private int courseId;
|
||||
|
||||
public CursusCourse(Cursus cursus, Course course){
|
||||
this.cursus = cursus;
|
||||
this.course = course;
|
||||
public CursusCourse(int cursusId, int courseId){
|
||||
this.cursusId = cursusId;
|
||||
this.courseId = courseId;
|
||||
}
|
||||
|
||||
public CursusCourse() {}
|
||||
@ -27,19 +25,19 @@ public class CursusCourse {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Course getCourse() {
|
||||
return course;
|
||||
public int getCourseId() {
|
||||
return courseId;
|
||||
}
|
||||
|
||||
public void setCourse(Course course){
|
||||
this.course = course;
|
||||
public void setCourseId(int courseId){
|
||||
this.courseId = courseId;
|
||||
}
|
||||
|
||||
public Cursus getCursus() {
|
||||
return cursus;
|
||||
public int getCursusId() {
|
||||
return cursusId;
|
||||
}
|
||||
|
||||
public void setCursus(Cursus cursus) {
|
||||
this.cursus = cursus;
|
||||
public void setCursusId(int cursusId) {
|
||||
this.cursusId = cursusId;
|
||||
}
|
||||
}
|
||||
|
@ -8,13 +8,12 @@ public class Secretary {
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private int id;
|
||||
|
||||
@OneToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "Users")
|
||||
private User user;
|
||||
private int regNo;
|
||||
private String faculty;
|
||||
|
||||
public Secretary(User user, String faculty){
|
||||
this.user = user;
|
||||
public Secretary(int regNo, String faculty){
|
||||
this.regNo = regNo;
|
||||
this.faculty = faculty;
|
||||
}
|
||||
|
||||
@ -24,12 +23,12 @@ public class Secretary {
|
||||
return id;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
public int getRegNo() {
|
||||
return regNo;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
public void setRegNo(int regNo) {
|
||||
this.regNo = regNo;
|
||||
}
|
||||
|
||||
public String getFaculty() {
|
||||
|
@ -8,21 +8,18 @@ public class TeacherGivenCourse {
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private int id;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "Users")
|
||||
private User user;
|
||||
private int regNo;
|
||||
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "Course")
|
||||
private Course course;
|
||||
private int courseId;
|
||||
|
||||
//This flag helps make the difference between an assistant or a Teacher (who owns the course)
|
||||
private boolean owned;
|
||||
|
||||
public TeacherGivenCourse(User user, Course course, boolean owned){
|
||||
this.user = user;
|
||||
this.course = course;
|
||||
public TeacherGivenCourse(int regNo, int courseId, boolean owned){
|
||||
this.regNo = regNo;
|
||||
this.courseId = courseId;
|
||||
this.owned = owned;
|
||||
}
|
||||
|
||||
@ -32,20 +29,20 @@ public class TeacherGivenCourse {
|
||||
return id;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
public int getRegNo() {
|
||||
return regNo;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
public void setRegNo(int regNo) {
|
||||
this.regNo = regNo;
|
||||
}
|
||||
|
||||
public Course getCourse() {
|
||||
return course;
|
||||
public int getCourseId() {
|
||||
return courseId;
|
||||
}
|
||||
|
||||
public void setCourse(Course course) {
|
||||
this.course = course;
|
||||
public void setCourseId(int courseId) {
|
||||
this.courseId = courseId;
|
||||
}
|
||||
|
||||
public boolean isOwned() {
|
||||
|
@ -20,17 +20,15 @@ public class User {
|
||||
private String address;
|
||||
private String country;
|
||||
private Date birthDate;
|
||||
private String profilePictureUrl;
|
||||
private ovh.herisson.Clyde.Tables.Role role;
|
||||
private String password;
|
||||
public User(String lastName, String firstName, String email, String address, String country, Date birthDate, String profilePictureUrl, Role role, String password){
|
||||
public User(String lastName, String firstName, String email, String address, String country, Date birthDate, Role role, String password){
|
||||
this.lastName = lastName;
|
||||
this.firstName = firstName;
|
||||
this.email = email;
|
||||
this.address = address;
|
||||
this.country = country;
|
||||
this.birthDate = birthDate;
|
||||
this.profilePictureUrl = profilePictureUrl;
|
||||
this.role = role;
|
||||
this.password = password;
|
||||
}
|
||||
@ -88,11 +86,6 @@ public class User {
|
||||
this.birthDate = birthDate;
|
||||
}
|
||||
|
||||
public String getProfilePictureUrl(){return this.profilePictureUrl;}
|
||||
|
||||
public void setProfilePictureUrl(String profilePictureUrl){
|
||||
this.profilePictureUrl = profilePictureUrl;
|
||||
}
|
||||
public ovh.herisson.Clyde.Tables.Role getRole() {
|
||||
return role;
|
||||
}
|
||||
|
@ -7,19 +7,15 @@ public class UserCursus {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private int id;
|
||||
|
||||
//Un étudiant peut avoir plusieurs cursus
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "Users")
|
||||
private User user;
|
||||
private int regNo;
|
||||
|
||||
@OneToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "Cursus")
|
||||
private Cursus cursus;
|
||||
private int cursusId;
|
||||
|
||||
public UserCursus(User user, Cursus cursus){
|
||||
this.user = user;
|
||||
this.cursus = cursus;
|
||||
public UserCursus(int regNo, int cursusId){
|
||||
this.regNo = regNo;
|
||||
this.cursusId = cursusId;
|
||||
}
|
||||
|
||||
public UserCursus() {}
|
||||
@ -28,19 +24,19 @@ public class UserCursus {
|
||||
return id;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
public int getRegNo() {
|
||||
return regNo;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
public void setRegNo(int regNo) {
|
||||
this.regNo = regNo;
|
||||
}
|
||||
|
||||
public Cursus getCursus() {
|
||||
return cursus;
|
||||
public int getCursusId() {
|
||||
return cursusId;
|
||||
}
|
||||
|
||||
public void setCursus(Cursus cursus) {
|
||||
this.cursus = cursus;
|
||||
public void setCursusId(int cursusId) {
|
||||
this.cursusId = cursusId;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user