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.description;
|
11
|
|
12
|
import eu.etaxonomy.cdm.model.location.NamedArea;
|
13
|
import org.apache.log4j.Logger;
|
14
|
import org.hibernate.annotations.Cascade;
|
15
|
import org.hibernate.annotations.CascadeType;
|
16
|
import javax.persistence.*;
|
17
|
|
18
|
/**
|
19
|
* fact attribute contains the concrete occurrence term like "Extinct" This allows
|
20
|
* all terms to enter the database and classify them basically according to class
|
21
|
* hierarchy of distribution. {validInRegion mandatory} {type is "distribution"}
|
22
|
* @author m.doering
|
23
|
* @version 1.0
|
24
|
* @created 08-Nov-2007 13:06:21
|
25
|
*/
|
26
|
@Entity
|
27
|
public class Distribution extends DescriptionElementBase {
|
28
|
static Logger logger = Logger.getLogger(Distribution.class);
|
29
|
|
30
|
private NamedArea area;
|
31
|
private PresenceAbsenceTermBase status;
|
32
|
|
33
|
|
34
|
/**
|
35
|
* Creates an empty distribution. Feature set to <code>Feature.DISTRIBUTION</code>
|
36
|
* @return
|
37
|
*/
|
38
|
public static Distribution NewInstance(){
|
39
|
Distribution result = new Distribution();
|
40
|
return result;
|
41
|
}
|
42
|
|
43
|
/**
|
44
|
* Creates a distribution and sets the area and status. Feature is set to <code>Feature.DISTRIBUTION</code>
|
45
|
* @return
|
46
|
*/
|
47
|
public static Distribution NewInstance(NamedArea area, PresenceAbsenceTermBase status){
|
48
|
Distribution result = new Distribution();
|
49
|
result.setArea(area);
|
50
|
result.setStatus(status);
|
51
|
return result;
|
52
|
}
|
53
|
|
54
|
protected Distribution(){
|
55
|
super(Feature.DISTRIBUTION());
|
56
|
}
|
57
|
|
58
|
|
59
|
/** Deprecated because feature should always be <code>DISTRIBUTION</code> for class Distribution
|
60
|
*/
|
61
|
/* (non-Javadoc)
|
62
|
* @see eu.etaxonomy.cdm.model.description.DescriptionElementBase#setFeature(eu.etaxonomy.cdm.model.description.Feature)
|
63
|
*/
|
64
|
@Override
|
65
|
@Deprecated
|
66
|
public void setFeature(Feature feature) {
|
67
|
super.setFeature(feature);
|
68
|
}
|
69
|
|
70
|
@ManyToOne
|
71
|
@Cascade({CascadeType.SAVE_UPDATE})
|
72
|
public NamedArea getArea(){
|
73
|
return this.area;
|
74
|
}
|
75
|
public void setArea(NamedArea area){
|
76
|
this.area = area;
|
77
|
}
|
78
|
|
79
|
@ManyToOne
|
80
|
public PresenceAbsenceTermBase getStatus(){
|
81
|
return this.status;
|
82
|
}
|
83
|
public void setStatus(PresenceAbsenceTermBase status){
|
84
|
this.status = status;
|
85
|
}
|
86
|
|
87
|
}
|