fix: updating foreign keys when adding new entity to the db
This commit is contained in:
MyINPulse-back/src/main/java/enseirb/myinpulse
@ -11,7 +11,7 @@ import java.util.List;
|
||||
public class SectionCell {
|
||||
|
||||
@ManyToMany(mappedBy = "listSectionCell")
|
||||
private final List<Appointment> appointment = new ArrayList<>();
|
||||
private final List<Appointment> listAppointment = new ArrayList<>();
|
||||
|
||||
@OneToMany(mappedBy = "sectionCellAnnotation", fetch = FetchType.LAZY, orphanRemoval = true)
|
||||
private final List<Annotation> listAnnotation = new ArrayList<>();
|
||||
@ -39,11 +39,13 @@ public class SectionCell {
|
||||
Long idSectionCell,
|
||||
Long sectionId,
|
||||
String contentSectionCell,
|
||||
LocalDateTime modificationDate) {
|
||||
LocalDateTime modificationDate,
|
||||
Project projectSectionCell) {
|
||||
this.idSectionCell = idSectionCell;
|
||||
this.sectionId = sectionId;
|
||||
this.contentSectionCell = contentSectionCell;
|
||||
this.modificationDate = modificationDate;
|
||||
this.projectSectionCell = projectSectionCell;
|
||||
}
|
||||
|
||||
public Long getIdSectionCell() {
|
||||
@ -83,6 +85,26 @@ public class SectionCell {
|
||||
}
|
||||
|
||||
public List<Appointment> getAppointmentSectionCell() {
|
||||
return appointment;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user