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
|
import org.hibernate.annotations.Cascade;
|
17
|
import org.hibernate.annotations.CascadeType;
|
18
|
|
19
|
import eu.etaxonomy.cdm.model.common.EventBase;
|
20
|
|
21
|
import java.util.*;
|
22
|
import javax.persistence.*;
|
23
|
|
24
|
/**
|
25
|
* @author m.doering
|
26
|
* @version 1.0
|
27
|
* @created 08-Nov-2007 13:06:21
|
28
|
*/
|
29
|
@Entity
|
30
|
public class DeterminationEvent extends EventBase {
|
31
|
static Logger logger = Logger.getLogger(DeterminationEvent.class);
|
32
|
|
33
|
private SpecimenOrObservationBase identifiedUnit;
|
34
|
private Taxon taxon;
|
35
|
private DeterminationModifier modifier;
|
36
|
private String preferredFlag;
|
37
|
|
38
|
|
39
|
|
40
|
/**
|
41
|
* Factory method
|
42
|
* @return
|
43
|
*/
|
44
|
public static DeterminationEvent NewInstance(){
|
45
|
return new DeterminationEvent();
|
46
|
}
|
47
|
|
48
|
/**
|
49
|
* Constructor
|
50
|
*/
|
51
|
protected DeterminationEvent() {
|
52
|
super();
|
53
|
}
|
54
|
|
55
|
@ManyToOne
|
56
|
@Cascade( { CascadeType.SAVE_UPDATE })
|
57
|
public DeterminationModifier getModifier() {
|
58
|
return modifier;
|
59
|
}
|
60
|
|
61
|
public void setModifier(DeterminationModifier modifier) {
|
62
|
this.modifier = modifier;
|
63
|
}
|
64
|
|
65
|
@ManyToOne
|
66
|
@Cascade( { CascadeType.SAVE_UPDATE })
|
67
|
public Taxon getTaxon(){
|
68
|
return this.taxon;
|
69
|
}
|
70
|
|
71
|
/**
|
72
|
*
|
73
|
* @param taxon taxon
|
74
|
*/
|
75
|
public void setTaxon(Taxon taxon){
|
76
|
this.taxon = taxon;
|
77
|
}
|
78
|
|
79
|
|
80
|
@Transient
|
81
|
public Calendar getIdentificationDate(){
|
82
|
return this.getTimeperiod().getStart();
|
83
|
}
|
84
|
|
85
|
/**
|
86
|
*
|
87
|
* @param identificationDate identificationDate
|
88
|
*/
|
89
|
public void setIdentificationDate(Calendar identificationDate){
|
90
|
this.getTimeperiod().setStart(identificationDate);
|
91
|
}
|
92
|
|
93
|
@Transient
|
94
|
public Agent getDeterminer() {
|
95
|
return this.getActor();
|
96
|
}
|
97
|
public void setDeterminer(Agent determiner) {
|
98
|
this.setActor(determiner);
|
99
|
}
|
100
|
|
101
|
@ManyToOne
|
102
|
@Cascade( { CascadeType.SAVE_UPDATE })
|
103
|
public SpecimenOrObservationBase getIdentifiedUnit() {
|
104
|
return identifiedUnit;
|
105
|
}
|
106
|
|
107
|
public void setIdentifiedUnit(SpecimenOrObservationBase identifiedUnit) {
|
108
|
this.identifiedUnit = identifiedUnit;
|
109
|
}
|
110
|
|
111
|
public String getPreferredFlag() {
|
112
|
return preferredFlag;
|
113
|
}
|
114
|
|
115
|
public void setPreferredFlag(String preferredFlag) {
|
116
|
this.preferredFlag = preferredFlag;
|
117
|
}
|
118
|
|
119
|
|
120
|
}
|