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 for typified names which have a rank above "species", in this case the
25 * type has to be a "species" name}
28 * @created 08-Nov-2007 13:06:38
31 public class NameTypeDesignation
extends ReferencedEntityBase
{
32 static Logger logger
= Logger
.getLogger(NameTypeDesignation
.class);
33 private boolean isRejectedType
;
34 private boolean isConservedType
;
35 private TaxonNameBase typeSpecies
;
36 private TaxonNameBase typifiedName
;
38 protected NameTypeDesignation(TaxonNameBase typifiedName
, TaxonNameBase typeSpecies
, ReferenceBase citation
, String citationMicroReference
,
39 String originalNameString
, boolean isRejectedType
, boolean isConservedType
) {
40 super(citation
, citationMicroReference
, originalNameString
);
41 this.setTypeSpecies(typeSpecies
);
42 this.setTypifiedName(typifiedName
);
43 // the typified name has to be part of the same homotypical group as the type species
44 typifiedName
.setHomotypicalGroup(typeSpecies
.getHomotypicalGroup());
45 this.isRejectedType
= isRejectedType
;
46 this.isConservedType
= isConservedType
;
50 @Cascade({CascadeType
.SAVE_UPDATE
})
51 public TaxonNameBase
getTypifiedName() {
54 private void setTypifiedName(TaxonNameBase typifiedName
) {
55 this.typifiedName
= typifiedName
;
56 typifiedName
.nameTypeDesignations
.add(this);
61 @Cascade({CascadeType
.SAVE_UPDATE
})
62 public TaxonNameBase
getTypeSpecies(){
63 return this.typeSpecies
;
65 private void setTypeSpecies(TaxonNameBase typeSpecies
){
66 this.typeSpecies
= typeSpecies
;
69 public boolean isRejectedType(){
70 return this.isRejectedType
;
72 public void setRejectedType(boolean isRejectedType
){
73 this.isRejectedType
= isRejectedType
;
76 public boolean isConservedType(){
77 return this.isConservedType
;
79 public void setConservedType(boolean isConservedType
){
80 this.isConservedType
= isConservedType
;