Théo Le Lez c94d3654ce
All checks were successful
Format / formatting (push) Successful in 7s
Build / build (push) Successful in 31s
CI / build (push) Successful in 11s
fix: updating foreign keys when adding new entity to the db
2025-03-15 15:23:18 +01:00

62 lines
1.5 KiB
Java

package enseirb.myinpulse.model;
import jakarta.persistence.*;
@Entity
@Table(name = "annotation")
public class Annotation {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long idAnnotation;
private String comment;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "idSectionCell")
private SectionCell sectionCellAnnotation;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "idAdministrator")
private Administrator administratorAnnotation;
public Annotation() {}
public Annotation(Long idAnnotation, String commentary) {
this.idAnnotation = idAnnotation;
this.comment = comment;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
public Long getIdAnnotation() {
return idAnnotation;
}
public void setIdAnnotation(Long idAnnotation) {
this.idAnnotation = idAnnotation;
}
public SectionCell getSectionCellAnnotation() {
return sectionCellAnnotation;
}
public void setSectionCellAnnotation(SectionCell sectionCellAnnotation) {
this.sectionCellAnnotation = sectionCellAnnotation;
}
public Administrator getAdministratorAnnotation() {
return administratorAnnotation;
}
public void setAdministratorAnnotation(Administrator administratorAnnotation) {
this.administratorAnnotation = administratorAnnotation;
}
}