import org.apache.log4j.Logger;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
-
-import java.util.*;
import javax.persistence.*;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
/**
- * {only for typified names which have a rank above "species", in this case the
- * type has to be a "species" name}
+ *
+ * Only taxon names which have a rank above "species aggregate" are typified by other
+ * taxon names of lower rank. A type of a name of a genus or of any
+ * subdivision of a genus can only be the name of a species. A type of a name
+ * of a family or of any subdivision of a family is the name of a genus
+ * (or resolving it: a name of a species typifying this genus).
+ * Moreover the mentioned taxon name type may be rejected or conserved.
+ * Depending on the date of publication, the same designation could have the
+ * rejected status according to one reference and later have the conserved
+ * status according to another reference.
+ *
* @author m.doering
* @version 1.0
* @created 08-Nov-2007 13:06:38
*/
+@XmlType(name="NameTypeDesignation")
@Entity
public class NameTypeDesignation extends ReferencedEntityBase {
static Logger logger = Logger.getLogger(NameTypeDesignation.class);
private boolean isConservedType;
private TaxonNameBase typeSpecies;
private TaxonNameBase typifiedName;
+
+ /**
+ * Default Constructor
+ */
+ private NameTypeDesignation() {
+ super();
+ }
protected NameTypeDesignation(TaxonNameBase typifiedName, TaxonNameBase typeSpecies, ReferenceBase citation, String citationMicroReference,
String originalNameString, boolean isRejectedType, boolean isConservedType) {
this.isRejectedType = isRejectedType;
this.isConservedType = isConservedType;
}
-
-
+
@Cascade({CascadeType.SAVE_UPDATE})
public TaxonNameBase getTypifiedName() {
return typifiedName;
}
private void setTypifiedName(TaxonNameBase typifiedName) {
this.typifiedName = typifiedName;
- typifiedName.nameTypeDesignations.add(this);
+ if (typifiedName != null){
+ typifiedName.getNameTypeDesignations().add(this);
}
+ }
@ManyToOne