67 lines
2.1 KiB
Java
67 lines
2.1 KiB
Java
package enseirb.myinpulse.model;
|
|
|
|
import jakarta.persistence.*;
|
|
import jakarta.persistence.PrimaryKeyJoinColumn;
|
|
import jakarta.persistence.Table;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
@Entity
|
|
@Table(name = "administrator")
|
|
@PrimaryKeyJoinColumn(name = "idAdministrator", referencedColumnName = "idUser")
|
|
public class Administrator extends User {
|
|
|
|
@OneToMany(mappedBy = "projectAdministrator", fetch = FetchType.LAZY, orphanRemoval = true)
|
|
private final List<Project> listProject = new ArrayList<>();
|
|
|
|
/*@OneToMany(mappedBy = "administratorSectionCell", fetch = FetchType.LAZY, orphanRemoval = true)
|
|
private List<SectionCell> listSectionCell = new ArrayList<>();*/
|
|
// should now be useless
|
|
|
|
@OneToMany(mappedBy = "administratorAnnotation", fetch = FetchType.LAZY, orphanRemoval = true)
|
|
private final List<Annotation> listAnnotation = new ArrayList<>();
|
|
|
|
/*@OneToMany(mappedBy = "administratorAppointment", fetch = FetchType.LAZY, orphanRemoval = true)
|
|
private final List<Appointment> listAppointment = new ArrayList<>();*/
|
|
// should now be useless
|
|
|
|
@OneToOne(mappedBy = "administratorAppointment", fetch = FetchType.LAZY, orphanRemoval = true)
|
|
private MakeAppointment makeAppointment;
|
|
|
|
public Administrator() {}
|
|
|
|
public Administrator(
|
|
String userSurname,
|
|
String username,
|
|
String primaryMail,
|
|
String secondaryMail,
|
|
String phoneNumber) {
|
|
super(userSurname, username, primaryMail, secondaryMail, phoneNumber, false);
|
|
}
|
|
|
|
public List<Project> getListProject() {
|
|
return listProject;
|
|
}
|
|
|
|
public void updateListProject(Project project) {
|
|
listProject.add(project);
|
|
}
|
|
|
|
public List<Annotation> getListAnnotation() {
|
|
return listAnnotation;
|
|
}
|
|
|
|
public void updateListAnnotation(Annotation annotation) {
|
|
listAnnotation.add(annotation);
|
|
}
|
|
|
|
public MakeAppointment getMakeAppointment() {
|
|
return makeAppointment;
|
|
}
|
|
|
|
public void setMakeAppointment(MakeAppointment makeAppointment) {
|
|
this.makeAppointment = makeAppointment;
|
|
}
|
|
}
|