112 lines
2.5 KiB
Java
112 lines
2.5 KiB
Java
package fr.organizee.model;
|
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|
|
|
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(cascade = CascadeType.MERGE)
|
|
@JoinColumn(name="TEAM_ID")
|
|
@JsonIgnoreProperties("contact")
|
|
private Team team;
|
|
|
|
public Contact() {
|
|
}
|
|
|
|
public Contact(String nom, String prenom, String telephone, String email, String adresse, LocalDate dateNaissance, Team team) {
|
|
this.nom = nom;
|
|
this.prenom = prenom;
|
|
this.telephone = telephone;
|
|
this.email = email;
|
|
this.adresse = adresse;
|
|
this.dateNaissance = dateNaissance;
|
|
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 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;
|
|
}
|
|
|
|
public Team getTeam() {
|
|
return team;
|
|
}
|
|
public void setTeam(Team team) {
|
|
this.team = team;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "Contact{" +
|
|
"id=" + id +
|
|
", nom='" + nom + '\'' +
|
|
", prenom='" + prenom + '\'' +
|
|
", telephone='" + telephone + '\'' +
|
|
", email='" + email + '\'' +
|
|
", adresse='" + adresse + '\'' +
|
|
", dateNaissance=" + dateNaissance +
|
|
'}';
|
|
}
|
|
}
|