(no commit message)
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / agent / Team.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9
10 package eu.etaxonomy.cdm.model.agent;
11
12
13 import eu.etaxonomy.cdm.model.common.VersionableEntity;
14 import org.apache.log4j.Logger;
15
16 import java.util.*;
17 import javax.persistence.*;
18
19 /**
20 * A team exists for itself or is built with the persons who belong to it.
21 * In the first case the inherited attribute {@link common.IdentifiableEntity#titleCache titleCache} is to be used.
22 * In the second case at least all abbreviated names (the attributes Person.titleCache)
23 * or all full names (the strings returned by Person.generateTitle)
24 * of the persons must exist.
25 *
26 * @author m.doering
27 * @version 1.0
28 * @created 08-Nov-2007 13:06:58
29 */
30 @Entity
31 public class Team extends Agent {
32 static Logger logger = Logger.getLogger(Team.class);
33
34 //An abreviated name for the team (e. g. in case of nomenclatural authorteams). A non abreviated name for the team (e. g.
35 //in case of some bibliographical references)
36 private List<Person> teamMembers = new ArrayList();
37
38 public Team() {
39 super();
40 // TODO Auto-generated constructor stub
41 }
42
43 @ManyToMany
44 public List<Person> getTeamMembers(){
45 return this.teamMembers;
46 }
47 protected void setTeamMembers(List<Person> teamMembers){
48 this.teamMembers = teamMembers;
49 }
50 public void addTeamMember(Person person){
51 this.teamMembers.add(person);
52 }
53 public void removeTeamMember(Person person){
54 this.teamMembers.remove(person);
55 }
56
57 @Override
58 public String generateTitle() {
59 // TODO Auto-generated method stub
60 return null;
61 }
62
63 }