(no commit message)
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / agent / Institution.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.IdentifiableEntity;
14 import org.apache.log4j.Logger;
15 import org.hibernate.annotations.Cascade;
16 import org.hibernate.annotations.CascadeType;
17
18 import java.util.*;
19 import javax.persistence.*;
20
21 /**
22 * A public or private institution.
23 * It includes name, contact details and institution type.
24 * <p>
25 * See also the <a href="http://rs.tdwg.org/ontology/voc/Institution.rdf">TDWG Ontology</a>
26 *
27 * @author m.doering
28 * @version 1.0
29 * @created 08-Nov-2007 13:06:29
30 */
31 @Entity
32 public class Institution extends Agent {
33 public Institution() {
34 super();
35 // TODO Auto-generated constructor stub
36 }
37
38 static Logger logger = Logger.getLogger(Institution.class);
39 //Acronym, code or initials by which the institution is generally known
40 private String code;
41 private String name;
42 private Set<InstitutionType> types = new HashSet();
43 private Institution isPartOf;
44 private Contact contact;
45
46 @ManyToOne
47 @Cascade({CascadeType.SAVE_UPDATE})
48 public Contact getContact(){
49 return this.contact;
50 }
51 public void setContact(Contact contact){
52 this.contact = contact;
53 }
54
55 @ManyToMany
56 public Set<InstitutionType> getTypes(){
57 return this.types;
58 }
59 public void addTypes(InstitutionType t){
60 this.types.add(t);
61 }
62 public void removeTypes(InstitutionType t){
63 this.types.remove(t);
64 }
65 protected void setTypes(Set<InstitutionType> types){
66 this.types = types;
67 }
68
69
70 @ManyToOne
71 @Cascade({CascadeType.SAVE_UPDATE})
72 public Institution getIsPartOf(){
73 return this.isPartOf;
74 }
75 public void setIsPartOf(Institution isPartOf){
76 this.isPartOf = isPartOf;
77 }
78
79 public String getCode(){
80 return this.code;
81 }
82 public void setCode(String code){
83 this.code = code;
84 }
85
86
87 public String getName(){
88 return this.name;
89 }
90 public void setName(String name){
91 this.name = name;
92 }
93
94 @Override
95 public String generateTitle(){
96 return "";
97 }
98
99 }