Bonjour,

J'aimerais faire une relation many to many avec cette entité et ça me pose un problème lorsque j'essaye de deployer mon projet:

Error occurred during deployment: Exception while preparing the app : Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.6.1.v20150605-31e8258): org.eclipse.persistence.exceptions.EntityManagerSetupException Exception Description: Predeployment of PersistenceUnit [databasePU] failed. Internal Exception: Exception [EclipseLink-7174] (Eclipse Persistence Services - 2.6.1.v20150605-31e8258): org.eclipse.persistence.exceptions.ValidationException Exception Description: The getter method [method getEleves] on entity class [class ch.myapp.entity.bean.Cours] does not have a corresponding setter method defined.. Please see server.log for more details. Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method : javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.6.1.v20150605-31e8258): org.eclipse.persistence.exceptions.EntityManagerSetupException Exception Description: Predeployment of PersistenceUni .... msg.seeServerLog

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
57
58
59
60
61
62
63
64
65
66
67
68
69
package ch.myapp.entity.bean;
 
import java.io.Serializable;
import java.util.Set;
 
 
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
 
 
@Entity
@Table(name = "cours")
 
 
public class Cours implements Serializable {
 
 
    private int coursId;
    private String name;
    private Set<Eleve> eleves;
 
 
    public Cours() {
    }
 
 
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "cours_id")
    public int getCoursId() {
        return coursId;
    }
 
 
    public void setCoursId(int coursId) {
        this.coursId = coursId;
    }
 
 
    @Column(name = "name")
    public String getName() {
        return name;
    }
 
 
    public void setName(String name) {
        this.name = name;
    }
 
 
    @ManyToMany(targetEntity = Cours.class)
    public Set<Eleve> getEleves() {
        return eleves;
    }
 
 
    public void setEleve(Set<Eleve> eleves) {
        this.eleves = eleves;
    }
}
Toute aide pour réaliser cette relation n-n serait la bienvenue !

Merci