Théo Le Lez 6029457735
Some checks failed
Format / formatting (push) Failing after 4s
Build / build (push) Failing after 5m8s
CI / build (push) Successful in 10s
fix: more tests working, still need fixes
2025-04-16 10:36:59 +02:00

126 lines
3.3 KiB
Java

package enseirb.myinpulse.model;
import jakarta.persistence.*;
import org.hibernate.annotations.Generated;
import org.hibernate.generator.EventType;
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<Appointment> listAppointment = new ArrayList<>();
@OneToMany(mappedBy = "sectionCellAnnotation", fetch = FetchType.LAZY, orphanRemoval = true)
private final List<Annotation> listAnnotation = new ArrayList<>();
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long idSectionCell;
@Column(columnDefinition = "serial")
@Generated(event = EventType.INSERT)
private Long idReference;
@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 getIdReference() {
return idReference;
}
public void setIdReference(Long idReference) {
this.idReference = idReference;
}
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<Appointment> getAppointmentSectionCell() {
return listAppointment;
}
public void updateAppointmentSectionCell(Appointment appointment) {
listAppointment.add(appointment);
}
public List<Annotation> 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;
}
}