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
.name
;
13 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnitBase
;
14 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
15 import eu
.etaxonomy
.cdm
.model
.common
.ReferencedEntityBase
;
16 import org
.apache
.log4j
.Logger
;
17 import org
.hibernate
.annotations
.Cascade
;
18 import org
.hibernate
.annotations
.CascadeType
;
22 import javax
.persistence
.*;
23 import javax
.xml
.bind
.annotation
.XmlAccessType
;
24 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
25 import javax
.xml
.bind
.annotation
.XmlElement
;
26 import javax
.xml
.bind
.annotation
.XmlElementWrapper
;
27 import javax
.xml
.bind
.annotation
.XmlIDREF
;
28 import javax
.xml
.bind
.annotation
.XmlSchemaType
;
29 import javax
.xml
.bind
.annotation
.XmlType
;
32 * Taxon names which have the a rank "species" or below can only be typified
33 * by specimens. Above the species rank the taxon names are generally typified
34 * by taxon names with lower rank (species for genus and genus for family) but
35 * can also be typified directly by specimens.
39 * @created 08-Nov-2007 13:06:52
41 @XmlAccessorType(XmlAccessType
.FIELD
)
42 @XmlType(name
= "SpecimenTypeDesignation", propOrder
= {
49 public class SpecimenTypeDesignation
extends ReferencedEntityBase
{
51 static Logger logger
= Logger
.getLogger(SpecimenTypeDesignation
.class);
53 @XmlElement(name
= "HomotypicalGroup")
55 @XmlSchemaType(name
= "IDREF")
56 private HomotypicalGroup homotypicalGroup
;
58 @XmlElement(name
= "TypeSpecimen")
60 // @XmlSchemaType(name = "IDREF")
61 private DerivedUnitBase typeSpecimen
;
63 @XmlElement(name
= "TypeStatus")
64 private TypeDesignationStatus typeStatus
;
66 @XmlElementWrapper(name
= "TypifiedNames")
67 @XmlElement(name
= "TypifiedName")
69 @XmlSchemaType(name
= "IDREF")
70 private Set
<TaxonNameBase
> typifiedNames
= new HashSet
<TaxonNameBase
>();
72 public static SpecimenTypeDesignation
NewInstance(DerivedUnitBase specimen
, TypeDesignationStatus status
,
73 ReferenceBase citation
, String citationMicroReference
, String originalNameString
){
74 SpecimenTypeDesignation specTypeDesig
= new SpecimenTypeDesignation(specimen
, status
, citation
, citationMicroReference
, originalNameString
);
78 protected SpecimenTypeDesignation(){
82 private SpecimenTypeDesignation(DerivedUnitBase specimen
, TypeDesignationStatus status
, ReferenceBase citation
, String citationMicroReference
, String originalNameString
) {
83 super(citation
, citationMicroReference
, originalNameString
);
84 this.setTypeSpecimen(specimen
);
85 this.setTypeStatus(status
);
90 public HomotypicalGroup
getHomotypicalGroup() {
91 return homotypicalGroup
;
93 public void setHomotypicalGroup(HomotypicalGroup newHomotypicalGroup
) {
94 this.homotypicalGroup
= newHomotypicalGroup
;
99 @Cascade({CascadeType
.SAVE_UPDATE
})
100 public DerivedUnitBase
getTypeSpecimen(){
101 return this.typeSpecimen
;
103 public void setTypeSpecimen(DerivedUnitBase typeSpecimen
){
104 this.typeSpecimen
= typeSpecimen
;
108 public TypeDesignationStatus
getTypeStatus(){
109 return this.typeStatus
;
111 public void setTypeStatus(TypeDesignationStatus typeStatus
){
112 this.typeStatus
= typeStatus
;
116 * @return the typifiedNames
119 public Set
<TaxonNameBase
> getTypifiedNames() {
120 return typifiedNames
;
124 * @param typifiedNames the typifiedNames to set
126 public void setTypifiedNames(Set
<TaxonNameBase
> typifiedNames
) {
127 this.typifiedNames
= typifiedNames
;