Salut a tous je suis débutant en JPA
j'ai déjà développé la classe agent.java, mais le problème comment le transformé en une table
voila le code de classe:
S.V.P aidez moi d'avoir le table agent
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 package Dao; import java.io.Serializable; import java.util.*; import javax.persistence.*; @Entity public class Agent implements Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) private String id_Agent; private String nomAgent; private String prenomAgent; private String emailAgent; private String loginAgent; private String mpAgent; @Temporal(javax.persistence.TemporalType.DATE) private Date dateCreationCompteAgent; @Temporal(javax.persistence.TemporalType.DATE) private Date dateNaissanceAgent; @OneToMany(mappedBy = "agent") private List<Campus> campus = new ArrayList<Campus>(); @OneToMany(mappedBy = "agent") private List<Session> sessions = new ArrayList<Session>(); @OneToMany(mappedBy = "agent") private List<Journal> journaux = new ArrayList<Journal>(); @ManyToOne private Role role; @ManyToOne private EtatAgent etatAgent; @Override public int hashCode() { int hash = 0; hash += (getId_Agent() != null ? getId_Agent().hashCode() : 0); return hash; } @Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id_Agent fields are not set if (!(object instanceof Agent)) { return false; } Agent other = (Agent) object; if ((this.getId_Agent() == null && other.getId_Agent() != null) || (this.getId_Agent() != null && !this.id_Agent.equals(other.id_Agent))) { return false; } return true; } @Override public String toString() { return "Dao.Agent[id_Agent=" + getId_Agent() + "]"; } ////// le get() et set() de diffèrent attribut }
c très urgent
Partager