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
.DerivedUnit
;
14 import eu
.etaxonomy
.cdm
.model
.occurrence
.Specimen
;
15 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
16 import eu
.etaxonomy
.cdm
.model
.common
.ReferencedEntityBase
;
17 import org
.apache
.log4j
.Logger
;
18 import org
.hibernate
.annotations
.Cascade
;
19 import org
.hibernate
.annotations
.CascadeType
;
22 import javax
.persistence
.*;
25 * {only for typified names which have the "species" rank or below}
28 * @created 08-Nov-2007 13:06:52
31 public class SpecimenTypeDesignation
extends ReferencedEntityBase
{
32 static Logger logger
= Logger
.getLogger(SpecimenTypeDesignation
.class);
33 private HomotypicalGroup homotypicalGroup
;
34 private DerivedUnit typeSpecimen
;
35 private TypeDesignationStatus typeStatus
;
37 public SpecimenTypeDesignation(HomotypicalGroup homotypicalGroup
,
38 DerivedUnit specimen
, TypeDesignationStatus status
,
39 ReferenceBase citation
, String citationMicroReference
, String originalNameString
) {
40 super(citation
, citationMicroReference
, originalNameString
);
41 this.setHomotypicalGroup(homotypicalGroup
);
42 this.setTypeSpecimen(specimen
);
43 this.setTypeStatus(status
);
48 public HomotypicalGroup
getHomotypicalGroup() {
49 return homotypicalGroup
;
51 public void setHomotypicalGroup(HomotypicalGroup newHomotypicalGroup
) {
52 if(this.homotypicalGroup
== newHomotypicalGroup
) return;
53 if (homotypicalGroup
!= null) {
54 homotypicalGroup
.typeDesignations
.remove(this);
56 if (newHomotypicalGroup
!= null) {
57 newHomotypicalGroup
.typeDesignations
.add(this);
59 this.homotypicalGroup
= newHomotypicalGroup
;
64 @Cascade({CascadeType
.SAVE_UPDATE
})
65 public DerivedUnit
getTypeSpecimen(){
66 return this.typeSpecimen
;
68 public void setTypeSpecimen(DerivedUnit typeSpecimen
){
69 this.typeSpecimen
= typeSpecimen
;
73 public TypeDesignationStatus
getTypeStatus(){
74 return this.typeStatus
;
76 public void setTypeStatus(TypeDesignationStatus typeStatus
){
77 this.typeStatus
= typeStatus
;