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 javax
.persistence
.Entity
;
14 import javax
.persistence
.FetchType
;
15 import javax
.persistence
.ManyToOne
;
16 import javax
.persistence
.Transient
;
17 import javax
.xml
.bind
.annotation
.XmlAccessType
;
18 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
19 import javax
.xml
.bind
.annotation
.XmlElement
;
20 import javax
.xml
.bind
.annotation
.XmlIDREF
;
21 import javax
.xml
.bind
.annotation
.XmlRootElement
;
22 import javax
.xml
.bind
.annotation
.XmlSchemaType
;
23 import javax
.xml
.bind
.annotation
.XmlType
;
25 import org
.apache
.log4j
.Logger
;
26 import org
.hibernate
.annotations
.Cascade
;
27 import org
.hibernate
.annotations
.CascadeType
;
28 import org
.hibernate
.envers
.Audited
;
30 import eu
.etaxonomy
.cdm
.model
.occurrence
.DerivedUnitBase
;
31 import eu
.etaxonomy
.cdm
.model
.occurrence
.Specimen
;
32 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
35 * The class representing a typification of one or several {@link TaxonNameBase taxon names} by a
36 * {@link eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase specimen or a figure}. All {@link TaxonNameBase taxon names}
37 * which have a {@link Rank rank} "species aggregate" or lower can only be typified
38 * by specimens. Moreover each typification by a specimen (or by a figure) has a
39 * {@link SpecimenTypeDesignationStatus status} like "holotype" or "isotype".
41 * This class corresponds to: <ul>
42 * <li> NomenclaturalType according to the TDWG ontology
43 * <li> Typification (partially) according to the TCS
44 * <li> NomenclaturalTypeDesignation according to the ABCD schema
47 * @see TypeDesignationBase
48 * @see NameTypeDesignation
51 * @created 08-Nov-2007 13:06:38
53 @XmlRootElement(name
= "SpecimenTypeDesignation")
54 @XmlAccessorType(XmlAccessType
.FIELD
)
55 @XmlType(name
= "SpecimenTypeDesignation", propOrder
= {
60 public class SpecimenTypeDesignation
extends TypeDesignationBase
<SpecimenTypeDesignationStatus
>
61 implements ITypeDesignation
{
62 private static final long serialVersionUID
= 6481627446997275007L;
63 @SuppressWarnings("unused")
64 private static final Logger logger
= Logger
.getLogger(SpecimenTypeDesignation
.class);
66 @XmlElement(name
= "TypeSpecimen")
68 @XmlSchemaType(name
= "IDREF")
69 @ManyToOne(fetch
= FetchType
.LAZY
)
70 @Cascade(CascadeType
.SAVE_UPDATE
)
71 private DerivedUnitBase typeSpecimen
;
74 // * Creates a new specimen type designation instance
75 // * (including its {@link reference.ReferenceBase reference source} and eventually
76 // * the taxon name string originally used by this reference when establishing
77 // * the former designation) and adds it to the corresponding
78 // * {@link HomotypicalGroup#getSpecimenTypeDesignations() specimen type designation set} of the
79 // * {@link HomotypicalGroup homotypical group}.
81 // * @param specimen the derived unit (specimen or figure) used as type
82 // * @param status the type designation status
83 // * @param citation the reference source for the new designation
84 // * @param citationMicroReference the string with the details describing the exact localisation within the reference
85 // * @param originalNameString the taxon name string used originally in the reference source for the new designation
86 // * @see #SpecimenTypeDesignation(DerivedUnitBase, TypeDesignationStatus, ReferenceBase, String, String)
87 // * @see HomotypicalGroup#addSpecimenTypeDesignation(SpecimenTypeDesignation, boolean)
88 // * @see occurrence.DerivedUnitBase
90 // protected static SpecimenTypeDesignation NewInstance2(DerivedUnitBase specimen, TypeDesignationStatus status,
91 // ReferenceBase citation, String citationMicroReference, String originalNameString){
92 // SpecimenTypeDesignation specTypeDesig = new SpecimenTypeDesignation(specimen, status, citation, citationMicroReference, originalNameString);
93 // return specTypeDesig;
97 // ************* CONSTRUCTORS *************/
99 * Class constructor: creates a new empty specimen type designation.
101 * @see #SpecimenTypeDesignation(DerivedUnitBase, SpecimenTypeDesignationStatus,
102 * ReferenceBase, String, String, boolean)
104 protected SpecimenTypeDesignation(){
108 * Class constructor: creates a new specimen type designation instance
109 * (including its {@link eu.etaxonomy.cdm.model.reference.ReferenceBase reference source} and
110 * eventually the taxon name string originally used by this reference when
111 * establishing the former designation).
113 * @param specimen the derived unit (specimen or figure) used
115 * @param status the type designation status
116 * @param citation the reference source for the new designation
117 * @param citationMicroReference the string with the details describing
118 * the exact localisation within the reference
119 * @param originalNameString the taxon name string used originally in the
120 * reference source for the new designation
121 * @param isNotDesignated the boolean flag indicating whether there is no specimen type at all for
122 * <i>this</i> specimen type designation
123 * @see #SpecimenTypeDesignation()
124 * @see TaxonNameBase#addSpecimenTypeDesignation(Specimen, SpecimenTypeDesignationStatus, ReferenceBase, String, String, boolean, boolean)
125 * @see TypeDesignationBase#isNotDesignated()
126 * @see eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase
128 protected SpecimenTypeDesignation(DerivedUnitBase specimen
, SpecimenTypeDesignationStatus status
, ReferenceBase citation
, String citationMicroReference
,
129 String originalNameString
, boolean isNotDesignated
) {
130 super(citation
, citationMicroReference
, originalNameString
, isNotDesignated
);
131 this.setTypeSpecimen(specimen
);
132 this.setTypeStatus(status
);
135 //********* METHODS **************************************/
138 * Returns the {@link occurrence.DerivedUnitBase derived unit} (specimen or figure) that is used
139 * in <i>this</i> specimen type designation to typify the {@link TaxonNameBase taxon name}.
141 * @see #getHomotypicalGroup()
143 public DerivedUnitBase
getTypeSpecimen(){
144 return this.typeSpecimen
;
147 * @see #getTypeSpecimen()
149 public void setTypeSpecimen(DerivedUnitBase typeSpecimen
){
150 this.typeSpecimen
= typeSpecimen
;
154 * @see eu.etaxonomy.cdm.model.name.ITypeDesignation#isLectoType()
157 public boolean isLectoType() {
158 return getTypeStatus().isLectotype();