package fr.organizee.model; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import javax.persistence.*; import java.util.ArrayList; import java.util.List; @Entity public class Team { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; private String nom; @OneToMany(mappedBy = "team", fetch=FetchType.LAZY) @JsonIgnoreProperties("team") private List membres = new ArrayList<>(); @OneToMany(mappedBy = "team", fetch=FetchType.LAZY) @JsonIgnoreProperties("team") private List contacts = new ArrayList<>(); @OneToMany(mappedBy = "team", fetch=FetchType.LAZY) @JsonIgnoreProperties("team") private List todolists = new ArrayList<>(); @OneToMany(mappedBy = "team", fetch=FetchType.LAZY) @JsonIgnoreProperties("team") private List menus = new ArrayList<>(); public Team() { super(); } public Team(int id, String nom, List membre) { super(); this.id = id; this.nom = nom; this.membres = membre; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getNom() { return nom; } public void setNom(String nom) { this.nom = nom; } public List getMembre() { return membres; } public void setMembre(List membre) { this.membres = membre; } @Override public String toString() { return "Team [id=" + id + ", nom=" + nom + ", membre=" + membres + "]"; } }