package enseirb.myinpulse.model; import jakarta.persistence.*; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; @Entity @Table(name = "section_cell") public class SectionCell { @ManyToMany(mappedBy = "listSectionCell") private final List listAppointment = new ArrayList<>(); @OneToMany(mappedBy = "sectionCellAnnotation", fetch = FetchType.LAZY, orphanRemoval = true) private final List listAnnotation = new ArrayList<>(); @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long idSectionCell; @Column() private long sectionId; private String contentSectionCell; /*@ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "idAdministrator") private Administrator administratorSectionCell;*/ // should now be useless private LocalDateTime modificationDate; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "idProject") private Project projectSectionCell; public SectionCell() {} public SectionCell( Long idSectionCell, Long sectionId, String contentSectionCell, LocalDateTime modificationDate, Project projectSectionCell) { this.idSectionCell = idSectionCell; this.sectionId = sectionId; this.contentSectionCell = contentSectionCell; this.modificationDate = modificationDate; this.projectSectionCell = projectSectionCell; } public Long getIdSectionCell() { return idSectionCell; } public void setIdSectionCell(Long idSectionCell) { this.idSectionCell = idSectionCell; } public Long getSectionId() { return sectionId; } public void setSectionId(Long sectionId) { this.sectionId = sectionId; } public String getContentSectionCell() { return contentSectionCell; } public void setContentSectionCell(String contentSectionCell) { this.contentSectionCell = contentSectionCell; } public LocalDateTime getModificationDate() { return modificationDate; } public void setModificationDate(LocalDateTime modificationDate) { this.modificationDate = modificationDate; } public Project getProjectSectionCell() { return projectSectionCell; } public List getAppointmentSectionCell() { return listAppointment; } public void updateAppointmentSectionCell(Appointment appointment) { listAppointment.add(appointment); } public List getListAnnotation() { return listAnnotation; } public void updateListAnnotation(Annotation annotation) { listAnnotation.add(annotation); } public void setSectionId(long sectionId) { this.sectionId = sectionId; } public void setProjectSectionCell(Project projectSectionCell) { this.projectSectionCell = projectSectionCell; } }