Implemented Occurrence Service. Marshalling / unmarshalling SpecimenOrObservationBase.
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / occurrence / Specimen.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
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.
8 */
9
10 package eu.etaxonomy.cdm.model.occurrence;
11
12 import org.apache.log4j.Logger;
13 import javax.persistence.*;
14 import javax.xml.bind.annotation.XmlAccessType;
15 import javax.xml.bind.annotation.XmlAccessorType;
16 import javax.xml.bind.annotation.XmlElement;
17 import javax.xml.bind.annotation.XmlIDREF;
18 import javax.xml.bind.annotation.XmlRootElement;
19 import javax.xml.bind.annotation.XmlSchemaType;
20 import javax.xml.bind.annotation.XmlType;
21
22 /**
23 * A specimen is regarded as derived from an field observation,
24 * so locality and gathering related information is captured as a separate FieldObservation object
25 * related to a specimen via a derivation event
26 * @author m.doering
27 * @version 1.0
28 * @created 08-Nov-2007 13:06:52
29 */
30 @XmlAccessorType(XmlAccessType.FIELD)
31 @XmlType(name = "Specimen", propOrder = {
32 "preservation"
33 })
34 @XmlRootElement(name = "Specimen")
35 @Entity
36 public class Specimen extends DerivedUnitBase {
37 static Logger logger = Logger.getLogger(Specimen.class);
38
39 @XmlElement(name = "Preservation")
40 @XmlIDREF
41 @XmlSchemaType(name = "IDREF")
42 private PreservationMethod preservation;
43
44 /**
45 * Factory method
46 * @return
47 */
48 public static Specimen NewInstance(){
49 return new Specimen();
50 }
51
52 /**
53 * Constructor
54 */
55 protected Specimen() {
56 super();
57 }
58
59 @ManyToOne
60 public PreservationMethod getPreservation(){
61 return this.preservation;
62 }
63 public void setPreservation(PreservationMethod preservation){
64 this.preservation = preservation;
65 }
66
67 }