2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.cdm
.model
.agent
;
13 import org
.apache
.log4j
.Logger
;
14 import org
.hibernate
.annotations
.Cascade
;
15 import org
.hibernate
.annotations
.CascadeType
;
18 import javax
.persistence
.*;
21 * A public or private institution.
22 * It includes name, contact details and institution type.
24 * See also the <a href="http://rs.tdwg.org/ontology/voc/Institution.rdf">TDWG Ontology</a>
28 * @created 08-Nov-2007 13:06:29
31 public class Institution
extends Agent
{
32 static Logger logger
= Logger
.getLogger(Institution
.class);
35 private Set
<InstitutionType
> types
= new HashSet();
36 private Institution isPartOf
;
37 private Contact contact
;
42 public Institution() {
44 // TODO Auto-generated constructor stub
48 @Cascade({CascadeType
.SAVE_UPDATE
})
49 public Contact
getContact(){
53 * Assigns a {@link Contact contact} to this institution.
55 * @param contact the contact which should be assigned to this institution
57 public void setContact(Contact contact
){
58 this.contact
= contact
;
62 public Set
<InstitutionType
> getTypes(){
67 * Adds a new institutional type from the corresponding vocabulary
68 * to describe better this institution or circumscribe its activities.
70 * @param t any type of institution relevant for describing this institution
71 * @see InstitutionType
73 public void addType(InstitutionType t
){
78 * Removes one element from the set of institution types for this institution.
80 * @param t the institution type describing this institution or its activities
81 * which should be deleted
82 * @see #addType(InstitutionType)
84 public void removeType(InstitutionType t
){
87 protected void setTypes(Set
<InstitutionType
> types
){
93 @Cascade({CascadeType
.SAVE_UPDATE
})
94 public Institution
getIsPartOf(){
98 * Assigns a parent institution to this institution.
99 * This is for instance the case when a herbarium
100 * belongs to a museum (parent institution).
102 * @param isPartOf the institution to which this institution belongs
104 public void setIsPartOf(Institution isPartOf
){
105 this.isPartOf
= isPartOf
;
108 public String
getCode(){
112 * Assigns a code (can also be an acronym or initials)
113 * by which this institution is known among experts.
115 * @param code the string which should be assigned as an identification code
116 * to this institution
118 public void setCode(String code
){
123 public String
getName(){
127 * Assigns a full name, as distinct from a code, an acronym or initials,
128 * by which this institution is generally known.
130 * @param name the string which should be assigned as a full name
131 * to this institution
133 public void setName(String name
){
139 * Generates the complete identification string of this institution
140 * on the basis of all its attributes.
141 * This method overrides {@link common.IdentifiableEntity#generateTitle() generateTitle}.
142 * The result might be kept as {@link common.IdentifiableEntity#setTitleCache(String) titleCache} if the
143 * flag {@link common.IdentifiableEntity#protectedTitleCache protectedTitleCache} is not set.
145 * @return the string which contains the complete identification of this institution
147 public String
generateTitle(){