added set of research areas to employee domain object

This commit is contained in:
Emil Siverhall 2012-07-18 13:42:13 +02:00
parent 49a33cdfe6
commit ca79800488
2 changed files with 14 additions and 2 deletions
src/main/java/se/su/dsv/scipro
data/dataobjects
io/facade

@ -61,6 +61,10 @@ public class Employee extends ProjectTeamMember {
@AssociationOverride(name="keywords", joinTable=@JoinTable(name="Employee_Keyword"))
private Keywords keywords = new Keywords();
@ManyToMany
@JoinTable(name="employee_researcharea")
private Set<ResearchArea> researchAreas = new HashSet<ResearchArea>();
public Keywords getKeywords() {
return keywords;
}
@ -114,7 +118,15 @@ public class Employee extends ProjectTeamMember {
return true;
}
private static final long serialVersionUID = -2570983581219033271L;
public void setResearchAreas(Set<ResearchArea> researchAreas) {
this.researchAreas = researchAreas;
}
public Set<ResearchArea> getResearchAreas() {
return researchAreas;
}
private static final long serialVersionUID = -2570983581219033271L;
@Embeddable
public static class Capabilities implements Serializable {

@ -563,7 +563,7 @@ public class ImporterFacade {
private void addResearchAreaToUser(User user, ResearchArea area) {
Employee supervisor = supervisorDao.getFrom(user);
logger.info("Adding research area: " + area.getTitle() + " to supervisor " + supervisor.getUser().getFullName());
//supervisor.getKeywords().getAll().add(area);
supervisor.getResearchAreas().add(area);
}
@Transactional