* A derived unit is regarded as derived from a field unit,
* so locality and gathering related information is captured as a separate FieldUnit object
* related to a specimen via a derivation event
- *
+ *
* http://www.bgbm.org/biodivinf/docs/CollectionModel/ReprintTNR.pdf
* http://www.bgbm.org/biodivinf/docs/CollectionModel/
* <BR>
private static final long serialVersionUID = -3525746216270843517L;
private static final Logger logger = Logger.getLogger(DnaSample.class);
-
+
@XmlElement(name = "Collection")
@XmlIDREF
@XmlSchemaType(name = "IDREF")
@Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE })
private final Set<SpecimenTypeDesignation> specimenTypeDesignations = new HashSet<SpecimenTypeDesignation>();
-
+
//*** attributes valid only for preserved specimen (PreservedSpecimen, Fossil, DnaSample)
-
+
@XmlElement(name = "Preservation")
@XmlIDREF
@XmlSchemaType(name = "IDREF")
@ManyToOne(fetch = FetchType.LAZY)
+ @Cascade(CascadeType.SAVE_UPDATE)
private PreservationMethod preservation;
@Field
@Size(max = 255)
private String exsiccatum;
-
+
// ******************** FACTORY METHOD **********************************/
public static DerivedUnit NewInstance(SpecimenOrObservationType type) {
return new DerivedUnit(type);
}
-
+
/**
* Factory method
* @return
DerivedUnit result = new DerivedUnit(SpecimenOrObservationType.PreservedSpecimen);
return result;
}
-
-//************************** CONSTRUCTOR *********************************/
-
+
+//************************** CONSTRUCTOR *********************************/
+
//Constructor: For hibernate use only
protected DerivedUnit() {super();}
-
-
+
+
/**
* Constructor
* @param recordBasis
protected DerivedUnit(SpecimenOrObservationType recordBasis) {
super(recordBasis);
}
-
-
+
+
/**
* Create new unit derived from an existing field unit
* @param fieldUnit existing field unit from where this unit is derived
derivedFrom.getDerivatives().add(this);
this.setDerivedFrom(derivedFrom);
}
-
+
/**
* create new unit derived from an existing gathering event,
* thereby creating a new empty field unit
}
// ******************** GETTER / SETTER *************************************/
-
+
public DerivationEvent getDerivedFrom() {
return derivedFrom;
}
}
// ******* GETTER / SETTER for preserved specimen only ******************/
-
+
public Set<SpecimenTypeDesignation> getSpecimenTypeDesignations(){
return specimenTypeDesignations;
}
-
+
public PreservationMethod getPreservation(){
return this.preservation;
}