-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathProjet.java
110 lines (84 loc) · 2.38 KB
/
Projet.java
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
package tn.esprit.spring.entity;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
@Entity
public class Projet implements Serializable {
private static final long serialVersionUID = -5369734855993305723L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
private String nameproject;
private String descriptionproject;
@ManyToOne
private Departement departement;
@OneToMany(mappedBy = "projet")
private List<Employe> employes;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getNameproject() {
return nameproject;
}
public void setNameproject(String nameproject) {
this.nameproject = nameproject;
}
public String getDescriptionproject() {
return descriptionproject;
}
public void setDescriptionproject(String descriptionproject) {
this.descriptionproject = descriptionproject;
}
public Departement getDepartement() {
return departement;
}
public void setDepartement(Departement departement) {
this.departement = departement;
}
public List<Employe> getEmployes() {
return employes;
}
public void setEmployes(List<Employe> employes) {
this.employes = employes;
}
@Override
public int hashCode() {
return Objects.hash(departement, descriptionproject, employes, id, nameproject);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Projet other = (Projet) obj;
return Objects.equals(departement, other.departement)
&& Objects.equals(descriptionproject, other.descriptionproject)
&& Objects.equals(employes, other.employes) && id == other.id
&& Objects.equals(nameproject, other.nameproject);
}
@Override
public String toString() {
return "Projet [id=" + id + ", nameproject=" + nameproject + ", descriptionproject=" + descriptionproject
+ ", departement=" + departement + ", employes=" + employes + "]";
}
public Projet(String nameproject, String descriptionproject) {
super();
this.nameproject = nameproject;
this.descriptionproject = descriptionproject;
}
public Projet() {
super();
}
}