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
.common
.ReferencedEntityBase
;
14 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
16 import org
.apache
.log4j
.Logger
;
17 import org
.hibernate
.annotations
.Cascade
;
18 import org
.hibernate
.annotations
.CascadeType
;
21 import javax
.persistence
.*;
24 * Only taxon names which have a rank above "species" are typified by other
25 * taxon names of lower rank. A type of a name of a genus or of any
26 * subdivision of a genus can only be the name of a species. A type of a name
27 * of a family or of any subdivision of a family is the name of a genus
28 * (or resolving it: a name of a species typifying this genus).
29 * Moreover the mentioned taxon name type may be rejected or conserved.
30 * Depending on the date of publication, the same designation could have the
31 * rejected status according to one reference and later have the conserved
32 * status according to another reference.
36 * @created 08-Nov-2007 13:06:38
39 public class NameTypeDesignation
extends ReferencedEntityBase
{
40 static Logger logger
= Logger
.getLogger(NameTypeDesignation
.class);
41 private boolean isRejectedType
;
42 private boolean isConservedType
;
43 private TaxonNameBase typeSpecies
;
44 private TaxonNameBase typifiedName
;
46 protected NameTypeDesignation(TaxonNameBase typifiedName
, TaxonNameBase typeSpecies
, ReferenceBase citation
, String citationMicroReference
,
47 String originalNameString
, boolean isRejectedType
, boolean isConservedType
) {
48 super(citation
, citationMicroReference
, originalNameString
);
49 this.setTypeSpecies(typeSpecies
);
50 this.setTypifiedName(typifiedName
);
51 // the typified name has to be part of the same homotypical group as the type species
52 typifiedName
.setHomotypicalGroup(typeSpecies
.getHomotypicalGroup());
53 this.isRejectedType
= isRejectedType
;
54 this.isConservedType
= isConservedType
;
58 @Cascade({CascadeType
.SAVE_UPDATE
})
59 public TaxonNameBase
getTypifiedName() {
62 private void setTypifiedName(TaxonNameBase typifiedName
) {
63 this.typifiedName
= typifiedName
;
64 typifiedName
.nameTypeDesignations
.add(this);
69 @Cascade({CascadeType
.SAVE_UPDATE
})
70 public TaxonNameBase
getTypeSpecies(){
71 return this.typeSpecies
;
73 private void setTypeSpecies(TaxonNameBase typeSpecies
){
74 this.typeSpecies
= typeSpecies
;
77 public boolean isRejectedType(){
78 return this.isRejectedType
;
80 public void setRejectedType(boolean isRejectedType
){
81 this.isRejectedType
= isRejectedType
;
84 public boolean isConservedType(){
85 return this.isConservedType
;
87 public void setConservedType(boolean isConservedType
){
88 this.isConservedType
= isConservedType
;