Problème avec annotation JPA
salut,
je travail avec projet EJB qui se base sur jpa
donc il y'a des annotation specifique qui permet de faire les liaisons entre les tables exemple @OneToMany ....
mais pour mon cas
j'ai deux tables Expertise et TechnicalSkill
la relation entre ces deux table est : la table Expertise contient TechnicalSkill
liaison d’agrégation
donc je veux savoir comment traduire cette relation avec annotation jpa
la class Expertise.java
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
@Entity
public class Expertise {
private int idExpertise;
private int seniority;
@Id
public int getIdExpertise() {
return idExpertise;
}
public void setIdExpertise(int idExpertise) {
this.idExpertise = idExpertise;
}
public int getSeniority() {
return seniority;
}
public void setSeniority(int seniority) {
this.seniority = seniority;
}
} |
la class TechnicalSkill.java
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
@Entity
public class TechnicalSkill {
private int idTechnicalSkill;
private String description;
@Id
public int getIdTechnicalSkill() {
return idTechnicalSkill;
}
public void setIdTechnicalSkill(int idTechnicalSkill) {
this.idTechnicalSkill = idTechnicalSkill;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
} |
merci d'avance