149 lines
3.1 KiB
Java
149 lines
3.1 KiB
Java
package ovh.herisson.Clyde.Tables;
|
|
|
|
|
|
/******************************************************
|
|
* @file LessonChangesRequest.java
|
|
* @author William Karpinski
|
|
* @scope Extension Horaire
|
|
*
|
|
* Represent a request about changes on schedules and lessons
|
|
******************************************************/
|
|
|
|
import jakarta.persistence.*;
|
|
import org.hibernate.annotations.OnDelete;
|
|
import org.hibernate.annotations.OnDeleteAction;
|
|
|
|
@Entity
|
|
public class LessonChangesRequest {
|
|
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
|
private int id;
|
|
|
|
@ManyToOne
|
|
@JoinColumn(name = "Users")
|
|
@OnDelete(action = OnDeleteAction.CASCADE)
|
|
private User user;
|
|
|
|
private long lessonId;
|
|
|
|
private RequestState state;
|
|
|
|
private String lessonStart;
|
|
|
|
private String lessonEnd;
|
|
|
|
private String color;
|
|
@ManyToOne
|
|
@JoinColumn(name ="Course")
|
|
private Course course;
|
|
|
|
private String lessonType;
|
|
|
|
/**
|
|
* Can take 3 values:
|
|
* 0 : Request to CREATE a lesson
|
|
* 1 : Request to MODIFY an existing lesson
|
|
* 2 : Request to DELETE a lesson
|
|
*/
|
|
private int requestType;
|
|
|
|
public LessonChangesRequest(User user, RequestState state, String lessonStart,
|
|
String lessonEnd, String lessonType, Course course,
|
|
int requestType, String color,long lessonId){
|
|
this.user = user;
|
|
this.state = state;
|
|
this.requestType = requestType;
|
|
this.lessonType = lessonType;
|
|
this.lessonStart = lessonStart;
|
|
this.lessonEnd= lessonEnd;
|
|
this.color = color;
|
|
this.course = course;
|
|
this.lessonId = lessonId;
|
|
}
|
|
|
|
public LessonChangesRequest() {
|
|
|
|
}
|
|
|
|
public int getId() {
|
|
return id;
|
|
}
|
|
|
|
|
|
public RequestState getState() {
|
|
return state;
|
|
}
|
|
|
|
public User getUser() {
|
|
return user;
|
|
}
|
|
|
|
public long getLessonId(){
|
|
return lessonId;
|
|
}
|
|
|
|
public String getLessonStart() {
|
|
return lessonStart;
|
|
}
|
|
|
|
public String getLessonEnd() {
|
|
return lessonEnd;
|
|
}
|
|
|
|
|
|
|
|
public int getRequestType() {
|
|
return requestType;
|
|
}
|
|
|
|
public String getLessonType() {
|
|
return lessonType;
|
|
}
|
|
|
|
public String getColor() {
|
|
return color;
|
|
}
|
|
|
|
public Course getCourse() {
|
|
return course;
|
|
}
|
|
|
|
public void setState(RequestState state) {
|
|
this.state = state;
|
|
}
|
|
|
|
public void setUser(User user) {
|
|
this.user = user;
|
|
}
|
|
|
|
public void setLessonStart(String lessonStart) {
|
|
this.lessonStart = lessonStart;
|
|
}
|
|
|
|
public void setLessonType(String lessonType) {
|
|
this.lessonType = lessonType;
|
|
}
|
|
|
|
public void setLessonEnd(String lessonEnd) {
|
|
this.lessonEnd = lessonEnd;
|
|
}
|
|
|
|
public void setColor(String color) {
|
|
this.color = color;
|
|
}
|
|
|
|
public void setRequestType(int requestType) {
|
|
this.requestType = requestType;
|
|
}
|
|
|
|
|
|
public void setLessonId(long lessonId) {
|
|
this.lessonId = lessonId;
|
|
}
|
|
|
|
public void setCourse(Course course){
|
|
this.course = course;
|
|
}
|
|
}
|