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
.occurrence
;
12 import java
.util
.HashMap
;
14 import java
.util
.UUID
;
16 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
17 import eu
.etaxonomy
.cdm
.model
.common
.TermType
;
18 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
20 import org
.apache
.log4j
.Logger
;
21 import org
.hibernate
.envers
.Audited
;
22 import org
.hibernate
.search
.annotations
.Indexed
;
24 import javax
.persistence
.*;
25 import javax
.xml
.bind
.annotation
.XmlAccessType
;
26 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
27 import javax
.xml
.bind
.annotation
.XmlRootElement
;
28 import javax
.xml
.bind
.annotation
.XmlType
;
31 * http://rs.tdwg.org/ontology/voc/Collection.rdf#SpecimenPreservationMethodTypeTerm
33 * @created 08-Nov-2007 13:06:44
35 @XmlAccessorType(XmlAccessType
.FIELD
)
36 @XmlType(name
= "PreservationMethod")
37 @XmlRootElement(name
= "PreservationMethod")
39 @Indexed(index
= "eu.etaxonomy.cdm.model.common.DefinedTermBase")
41 public class PreservationMethod
extends DefinedTermBase
<PreservationMethod
> {
42 private static final long serialVersionUID
= -6597303767771121540L;
43 @SuppressWarnings("unused")
44 private static final Logger logger
= Logger
.getLogger(PreservationMethod
.class);
46 protected static Map
<UUID
, PreservationMethod
> termMap
= null;
49 //********************************** FACTORY METHOD *********************************/
55 public static PreservationMethod
NewInstance(){
56 return new PreservationMethod();
63 public static PreservationMethod
NewInstance(String term
, String label
, String labelAbbrev
) {
64 return new PreservationMethod(term
, label
, labelAbbrev
);
67 //********************************** CONSTRUCTOR *********************************/
69 //for hibernate use only
71 protected PreservationMethod() {
72 super(TermType
.PreservationMethod
);
79 protected PreservationMethod(String term
, String label
, String labelAbbrev
) {
80 super(TermType
.PreservationMethod
, term
, label
, labelAbbrev
);
83 // *************************** METHODS ******************************************************/
86 * @see eu.etaxonomy.cdm.model.common.DefinedTermBase#resetTerms()
89 public void resetTerms(){
95 protected void setDefaultTerms(TermVocabulary
<PreservationMethod
> termVocabulary
){
96 termMap
= new HashMap
<UUID
, PreservationMethod
>();
97 for (PreservationMethod term
: termVocabulary
.getTerms()){
98 termMap
.put(term
.getUuid(), term
);