Ajout class

This commit is contained in:
Hedi 2021-12-13 23:33:44 +01:00
parent c12222a047
commit efa6e62984
15 changed files with 466 additions and 1 deletions

2
.gitignore vendored
View File

@ -31,3 +31,5 @@ build/
### VS Code ###
.vscode/
/.idea/
/src/main/resources/

View File

@ -0,0 +1,101 @@
package fr.organizee.model;
import javax.persistence.*;
import java.time.LocalDate;
@Entity
public class Contact {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
private String nom ;
private String prenom;
private String telephone;
private String email;
private String adresse;
private LocalDate dateNaissance;
@ManyToOne(fetch= FetchType.EAGER)
@JoinColumn(name="TEAM_ID")
private Team team;
public Contact() {
}
public Contact(String nom, String prenom, String telephone, String email, String adresse, LocalDate dateNaissance) {
this.nom = nom;
this.prenom = prenom;
this.telephone = telephone;
this.email = email;
this.adresse = adresse;
this.dateNaissance = dateNaissance;
}
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 String getPrenom() {
return prenom;
}
public void setPrenom(String prenom) {
this.prenom = prenom;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getAdresse() {
return adresse;
}
public void setAdresse(String adresse) {
this.adresse = adresse;
}
public LocalDate getDateNaissance() {
return dateNaissance;
}
public void setDateNaissance(LocalDate dateNaissance) {
this.dateNaissance = dateNaissance;
}
@Override
public String toString() {
return "Contact{" +
"id=" + id +
", nom='" + nom + '\'' +
", prenom='" + prenom + '\'' +
", telephone='" + telephone + '\'' +
", email='" + email + '\'' +
", adresse='" + adresse + '\'' +
", dateNaissance=" + dateNaissance +
'}';
}
}

View File

@ -15,7 +15,97 @@ public class Membre {
private String email;
private String password;
private String isAdmin;
private String couleur;
@ManyToOne(fetch= FetchType.EAGER)
@JoinColumn(name="TEAM_ID")
private Team team;
// @ManyToOne
// private Smiley smiley;
public Membre() {
}
public Membre(String nom, String prenom, LocalDate dateNaissance, String email, String password, String isAdmin, String couleur, Team team) {
this.nom = nom;
this.prenom = prenom;
this.dateNaissance = dateNaissance;
this.email = email;
this.password = password;
this.isAdmin = isAdmin;
this.couleur = couleur;
this.team = team;
}
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 String getPrenom() {
return prenom;
}
public void setPrenom(String prenom) {
this.prenom = prenom;
}
public LocalDate getDateNaissance() {
return dateNaissance;
}
public void setDateNaissance(LocalDate dateNaissance) {
this.dateNaissance = dateNaissance;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getIsAdmin() {
return isAdmin;
}
public void setIsAdmin(String isAdmin) {
this.isAdmin = isAdmin;
}
public Team getTeam() {
return team;
}
public void setTeam(Team team) {
this.team = team;
}
public String getCouleur() {
return couleur;
}
public void setCouleur(String couleur) {
this.couleur = couleur;
}
@Override
public String toString() {
return "Membre{" +
"id=" + id +
", nom='" + nom + '\'' +
", prenom='" + prenom + '\'' +
", dateNaissance=" + dateNaissance +
", email='" + email + '\'' +
", password='" + password + '\'' +
", isAdmin='" + isAdmin + '\'' +
", couleur='" + couleur + '\'' +
", team=" + team +
'}';
}
}

View File

@ -0,0 +1,55 @@
package fr.organizee.model;
import javax.persistence.*;
import java.time.LocalDate;
@Entity
public class Menu {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
private String libelle;
private LocalDate dateMenu;
public Menu() {
}
public Menu(String libelle, LocalDate dateMenu) {
this.libelle = libelle;
this.dateMenu = dateMenu;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getLibelle() {
return libelle;
}
public void setLibelle(String libelle) {
this.libelle = libelle;
}
public LocalDate getDateMenu() {
return dateMenu;
}
public void setDateMenu(LocalDate dateMenu) {
this.dateMenu = dateMenu;
}
@Override
public String toString() {
return "Menu{" +
"id=" + id +
", libelle='" + libelle + '\'' +
", dateMenu=" + dateMenu +
'}';
}
}

View File

@ -0,0 +1,46 @@
package fr.organizee.model;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
@Entity
public class Smiley {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
private String smileyUrl;
@OneToMany
private List<Membre> membres = new ArrayList<>();
public Smiley() {
}
public Smiley(String smileyUrl) {
this.smileyUrl = smileyUrl;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getSmileyUrl() {
return smileyUrl;
}
public void setSmileyUrl(String smileyUrl) {
this.smileyUrl = smileyUrl;
}
@Override
public String toString() {
return "Smiley{" +
"id=" + id +
", smileyUrl='" + smileyUrl + '\'' +
'}';
}
}

View File

@ -0,0 +1,56 @@
package fr.organizee.model;
import javax.persistence.*;
@Entity
public class Tache {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
private String texte;
private boolean etat;
@ManyToOne
@JoinColumn(name = "todolist_id")
private TodoList todolist;
public Tache(String texte, boolean etat) {
this.texte = texte;
this.etat = etat;
}
public Tache() {
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTexte() {
return texte;
}
public void setTexte(String texte) {
this.texte = texte;
}
public boolean isEtat() {
return etat;
}
public void setEtat(boolean etat) {
this.etat = etat;
}
@Override
public String toString() {
return "Tache{" +
"id=" + id +
", texte='" + texte + '\'' +
", etat=" + etat +
'}';
}
}

View File

@ -11,5 +11,46 @@ public class Team {
private int id;
private String nom;
@OneToMany
private List<Membre> membre = new ArrayList<>();
private List<Membre> membres = new ArrayList<>();
@OneToMany
@JoinTable(name = "repertoire")
private List<Contact> contacts = new ArrayList<>();
@OneToMany
@JoinTable(name = "team_todolist")
private List<TodoList> todolists = new ArrayList<>();
public Team() {
super();
}
public Team(int id, String nom, List<Membre> 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<Membre> getMembre() {
return membres;
}
public void setMembre(List<Membre> membre) {
this.membres = membre;
}
@Override
public String toString() {
return "Team [id=" + id + ", nom=" + nom + ", membre=" + membres + "]";
}
}

View File

@ -0,0 +1,46 @@
package fr.organizee.model;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
@Entity
public class TodoList {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
private String nom;
@OneToMany(mappedBy = "todolist")
private List<Tache> taches = new ArrayList<>();
public TodoList() {
}
public TodoList(String nom) {
this.nom = nom;
}
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;
}
@Override
public String toString() {
return "TodoList{" +
"id=" + id +
", nom='" + nom + '\'' +
'}';
}
}

View File

@ -0,0 +1,4 @@
package fr.organizee.repository;
public interface ContactRepository {
}

View File

@ -0,0 +1,4 @@
package fr.organizee.repository;
public interface MembreRepository {
}

View File

@ -0,0 +1,4 @@
package fr.organizee.repository;
public interface MenuRepository {
}

View File

@ -0,0 +1,4 @@
package fr.organizee.repository;
public interface SmileyRepository {
}

View File

@ -0,0 +1,4 @@
package fr.organizee.repository;
public interface TacheRepository {
}

View File

@ -0,0 +1,4 @@
package fr.organizee.repository;
public interface TeamRepository {
}

View File

@ -0,0 +1,4 @@
package fr.organizee.repository;
public interface TodoListRepository {
}