1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
| package entity;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.validation.constraints.Size;
@Entity
public class Tache implements Serializable {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Long id;
@Column(nullable=false)
@Size(min=3, max=50, message="Le nom doit faire entre 3 et 50 caractères")
private String nom;
@Temporal(javax.persistence.TemporalType.DATE)
private Date dateCreation;
@Temporal(javax.persistence.TemporalType.DATE)
private Date dateEcheance;
@Column(nullable=false)
@Size(min=20, max=1000, message="La description doit faire entre 20 et 1000 caractères")
private String description;
private String etat;
@OneToMany
private List<Message> timeline;
@OneToMany
private List<Document> documents;
@ManyToOne(cascade = CascadeType.PERSIST)
private Utilisateur responsable;
@OneToMany
private List<Utilisateur> participants;
@OneToMany
private List<Avis> aviss;
public Tache() {
}
public Tache(String nom, Date dateCreation, Date dateEcheance, String description, String etat, List<Message> timeline, List<Document> documents, List<Utilisateur> participants) {
this.nom = nom;
this.dateCreation = dateCreation;
this.dateEcheance = dateEcheance;
this.description = description;
this.etat = etat;
this.timeline = timeline;
this.documents = documents;
this.participants = participants;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
public Date getDateCreation() {
return dateCreation;
}
public void setDateCreation(Date dateCreation) {
this.dateCreation = dateCreation;
}
public Date getDateEcheance() {
return dateEcheance;
}
public void setDateEcheance(Date dateEcheance) {
this.dateEcheance = dateEcheance;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getEtat() {
return etat;
}
public void setEtat(String etat) {
this.etat = etat;
}
public List<Message> getTimeline() {
return timeline;
}
public void setTimeline(List<Message> timeline) {
this.timeline = timeline;
}
public List<Document> getDocuments() {
return documents;
}
public void setDocuments(List<Document> documents) {
this.documents = documents;
}
public Utilisateur getResponsable() {
return responsable;
}
public void setResponsable(Utilisateur responsable) {
this.responsable = responsable;
}
public List<Utilisateur> getParticipants() {
return participants;
}
public void setParticipants(List<Utilisateur> participants) {
this.participants = participants;
}
public List<Avis> getAviss() {
return aviss;
}
public void setAviss(List<Avis> aviss) {
this.aviss = aviss;
}
} |
Partager