Modif class/repo/controller
This commit is contained in:
parent
93c3ae454d
commit
48c83433b8
6 changed files with 61 additions and 93 deletions
|
|
@ -23,11 +23,10 @@ public class Membre {
|
|||
// @ManyToOne
|
||||
// @JoinColumn(name="TEAM_ID")
|
||||
// @JsonIgnore
|
||||
|
||||
@ManyToOne(cascade = CascadeType.MERGE)
|
||||
@JoinColumn(name="TEAM_ID")
|
||||
@JsonIgnoreProperties("membre")
|
||||
private Team team;
|
||||
private Team team;
|
||||
|
||||
public Membre() {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package fr.organizee.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.time.LocalDate;
|
||||
|
||||
|
|
@ -10,7 +12,9 @@ public class Menu {
|
|||
private int id;
|
||||
private String libelle;
|
||||
private LocalDate dateMenu;
|
||||
@ManyToOne
|
||||
@ManyToOne(cascade = CascadeType.MERGE)
|
||||
@JoinColumn(name="TEAM_ID")
|
||||
@JsonIgnoreProperties("menu")
|
||||
private Team team;
|
||||
@ManyToOne
|
||||
private Membre membre;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package fr.organizee.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Entity
|
||||
|
|
@ -8,12 +10,13 @@ public class Tache {
|
|||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private int id;
|
||||
private String texte;
|
||||
private boolean etat;
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "todolist_id")
|
||||
private Boolean etat;
|
||||
@ManyToOne(cascade = CascadeType.MERGE)
|
||||
@JoinColumn(name="TODOLIST_ID")
|
||||
@JsonIgnoreProperties("tache")
|
||||
private TodoList todolist;
|
||||
|
||||
public Tache(String texte, boolean etat) {
|
||||
public Tache(String texte, Boolean etat) {
|
||||
this.texte = texte;
|
||||
this.etat = etat;
|
||||
}
|
||||
|
|
@ -37,14 +40,22 @@ public class Tache {
|
|||
this.texte = texte;
|
||||
}
|
||||
|
||||
public boolean isEtat() {
|
||||
public Boolean getEtat() {
|
||||
return etat;
|
||||
}
|
||||
|
||||
public void setEtat(boolean etat) {
|
||||
public void setEtat(Boolean etat) {
|
||||
this.etat = etat;
|
||||
}
|
||||
|
||||
public TodoList getTodolist() {
|
||||
return todolist;
|
||||
}
|
||||
|
||||
public void setTodolist(TodoList todolist) {
|
||||
this.todolist = todolist;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Tache{" +
|
||||
|
|
|
|||
|
|
@ -17,13 +17,12 @@ public class Team {
|
|||
private List<Membre> membres = new ArrayList<>();
|
||||
@OneToMany(mappedBy = "team", fetch=FetchType.LAZY)
|
||||
@JsonIgnoreProperties("team")
|
||||
//@JoinTable(name = "repertoire")
|
||||
private List<Contact> contacts = new ArrayList<>();
|
||||
@OneToMany
|
||||
@JoinTable(name = "team_todolist")
|
||||
@OneToMany(mappedBy = "team", fetch=FetchType.LAZY)
|
||||
@JsonIgnoreProperties("team")
|
||||
private List<TodoList> todolists = new ArrayList<>();
|
||||
@OneToMany
|
||||
@JoinTable(name="team_menu")
|
||||
@OneToMany(mappedBy = "team", fetch=FetchType.LAZY)
|
||||
@JsonIgnoreProperties("team")
|
||||
private List<Menu> menus = new ArrayList<>();
|
||||
|
||||
public Team() {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package fr.organizee.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
@ -10,8 +12,10 @@ public class TodoList {
|
|||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private int id;
|
||||
private String nom;
|
||||
@OneToMany(mappedBy = "todolist")
|
||||
private List<Tache> taches = new ArrayList<>();
|
||||
@ManyToOne(cascade = CascadeType.MERGE)
|
||||
@JoinColumn(name="TEAM_ID")
|
||||
@JsonIgnoreProperties("todolist")
|
||||
private Team team;
|
||||
|
||||
public TodoList() {
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue