Opportunity to omit term loading during DB initialization.
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / occurrence / DeterminationEvent.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
13 import eu.etaxonomy.cdm.model.agent.Agent;
14 import eu.etaxonomy.cdm.model.taxon.Taxon;
15 import org.apache.log4j.Logger;
16
17 import eu.etaxonomy.cdm.model.common.EventBase;
18
19 import java.util.*;
20 import javax.persistence.*;
21
22 /**
23 * @author m.doering
24 * @version 1.0
25 * @created 08-Nov-2007 13:06:21
26 */
27 @Entity
28 public class DeterminationEvent extends EventBase {
29 static Logger logger = Logger.getLogger(DeterminationEvent.class);
30
31 private SpecimenOrObservationBase identifiedUnit;
32 private Taxon taxon;
33 private DeterminationModifier modifier;
34
35
36 /**
37 * Factory method
38 * @return
39 */
40 public static DeterminationEvent NewInstance(){
41 return new DeterminationEvent();
42 }
43
44 /**
45 * Constructor
46 */
47 protected DeterminationEvent() {
48 super();
49 }
50
51 @ManyToOne
52 public DeterminationModifier getModifier() {
53 return modifier;
54 }
55
56 public void setModifier(DeterminationModifier modifier) {
57 this.modifier = modifier;
58 }
59
60 @ManyToOne
61 public Taxon getTaxon(){
62 return this.taxon;
63 }
64
65 /**
66 *
67 * @param taxon taxon
68 */
69 public void setTaxon(Taxon taxon){
70 this.taxon = taxon;
71 }
72
73
74 @Transient
75 public Calendar getIdentificationDate(){
76 return this.getTimeperiod().getStart();
77 }
78
79 /**
80 *
81 * @param identificationDate identificationDate
82 */
83 public void setIdentificationDate(Calendar identificationDate){
84 this.getTimeperiod().setStart(identificationDate);
85 }
86
87 @Transient
88 public Agent getDeterminer() {
89 return this.getActor();
90 }
91 public void setDeterminer(Agent determiner) {
92 this.setActor(determiner);
93 }
94
95 @ManyToOne
96 public SpecimenOrObservationBase getIdentifiedUnit() {
97 return identifiedUnit;
98 }
99
100 public void setIdentifiedUnit(SpecimenOrObservationBase identifiedUnit) {
101 this.identifiedUnit = identifiedUnit;
102 }
103
104 }