import org.hibernate.annotations.CascadeType;
import org.hibernate.envers.Audited;
-import eu.etaxonomy.cdm.model.common.ReferencedEntityBase;
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
/**
@ManyToOne(fetch = FetchType.LAZY)
@Cascade(CascadeType.SAVE_UPDATE)
private TaxonNameBase typeName;
+
+
+ public static NameTypeDesignation NewInstance() {
+ return new NameTypeDesignation();
+ }
// ************* CONSTRUCTORS *************/
protected NameTypeDesignation() {
}
+
/**
* Class constructor: creates a new name type designation instance
* (including its {@link eu.etaxonomy.cdm.model.reference.ReferenceBase reference source} and eventually
* @see TypeDesignationBase#isNotDesignated()
* @see TaxonNameBase#addNameTypeDesignation(TaxonNameBase, ReferenceBase, String, String, boolean, boolean, boolean, boolean, boolean)
*/
- protected NameTypeDesignation(TaxonNameBase typeName, ReferenceBase citation, String citationMicroReference,
- String originalNameString, NameTypeDesignationStatus status, boolean rejectedType, boolean conservedType, /*boolean lectoType,*/ boolean isNotDesignated) {
- super(citation, citationMicroReference, originalNameString, isNotDesignated);
- this.setTypeName(typeName);
+ protected NameTypeDesignation( TaxonNameBase typeName,
+ ReferenceBase citation,
+ String citationMicroReference,
+ String originalNameString,
+ NameTypeDesignationStatus status,
+ boolean rejectedType,
+ boolean conservedType,
+ boolean isNotDesignated
+ ) {
+ this(typeName, status, citation, citationMicroReference, originalNameString);
+ this.setNotDesignated(isNotDesignated);
this.rejectedType = rejectedType;
this.conservedType = conservedType;
-// this.lectoType = lectoType;
}
//********* METHODS **************************************/
/**
* @see #getTypeName()
*/
- private void setTypeName(TaxonNameBase typeName){
+ public void setTypeName(TaxonNameBase typeName){
this.typeName = typeName;
}
@Transient
public boolean isLectoType() {
+ if (getTypeStatus() == null) {
+ return false;
+ }
return getTypeStatus().isLectotype();
}