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 javax.persistence.Entity;
|
13
|
import javax.xml.bind.annotation.XmlAccessType;
|
14
|
import javax.xml.bind.annotation.XmlAccessorType;
|
15
|
import javax.xml.bind.annotation.XmlRootElement;
|
16
|
import javax.xml.bind.annotation.XmlType;
|
17
|
|
18
|
import org.apache.log4j.Logger;
|
19
|
import org.hibernate.envers.Audited;
|
20
|
import org.springframework.beans.factory.annotation.Configurable;
|
21
|
|
22
|
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
|
23
|
import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
|
24
|
import eu.etaxonomy.cdm.strategy.cache.description.SpecimenDescriptionDefaultCacheStrategy;
|
25
|
|
26
|
/**
|
27
|
* This class represents descriptions for {@link SpecimenOrObservationBase specimens or observations}.
|
28
|
* <P>
|
29
|
* This class corresponds to DescriptionsBaseType with an "Object" element
|
30
|
* according to the SDD schema.
|
31
|
*
|
32
|
* @author a.mueller
|
33
|
* @version 1.0
|
34
|
* @created 08-Jul-2008
|
35
|
*/
|
36
|
@XmlAccessorType(XmlAccessType.FIELD)
|
37
|
@XmlType(name = "SpecimenDescription")
|
38
|
@XmlRootElement(name = "SpecimenDescription")
|
39
|
@Entity
|
40
|
//@Indexed disabled to reduce clutter in indexes, since this type is not used by any search
|
41
|
//@Indexed(index = "eu.etaxonomy.cdm.model.description.DescriptionBase")
|
42
|
@Audited
|
43
|
@Configurable
|
44
|
public class SpecimenDescription extends DescriptionBase<IIdentifiableEntityCacheStrategy<SpecimenDescription>> implements Cloneable {
|
45
|
private static final long serialVersionUID = -8506790426682192703L;
|
46
|
@SuppressWarnings("unused")
|
47
|
private static final Logger logger = Logger.getLogger(SpecimenDescription.class);
|
48
|
|
49
|
|
50
|
/**
|
51
|
* Class constructor: creates a new empty specimen description instance.
|
52
|
*/
|
53
|
public SpecimenDescription() {
|
54
|
super();
|
55
|
this.cacheStrategy = new SpecimenDescriptionDefaultCacheStrategy();
|
56
|
}
|
57
|
|
58
|
|
59
|
/**
|
60
|
* Creates a new empty specimen description instance.
|
61
|
*/
|
62
|
public static SpecimenDescription NewInstance(){
|
63
|
return new SpecimenDescription();
|
64
|
}
|
65
|
|
66
|
/**
|
67
|
* Creates a new empty specimen description instance.
|
68
|
*/
|
69
|
public static SpecimenDescription NewInstance(SpecimenOrObservationBase specimen){
|
70
|
SpecimenDescription description = new SpecimenDescription();
|
71
|
description.setDescribedSpecimenOrObservation(specimen);
|
72
|
return description;
|
73
|
}
|
74
|
|
75
|
//*********************** CLONE ********************************************************/
|
76
|
|
77
|
/**
|
78
|
* Clones <i>this</i> specimen description. This is a shortcut that enables to create
|
79
|
* a new instance that differs only slightly from <i>this</i> specimen description by
|
80
|
* modifying only some of the attributes.
|
81
|
*
|
82
|
* @see eu.etaxonomy.cdm.model.description.DescriptionBase#clone()
|
83
|
* @see java.lang.Object#clone()
|
84
|
*/
|
85
|
@Override
|
86
|
public Object clone() {
|
87
|
SpecimenDescription result;
|
88
|
result = (SpecimenDescription)super.clone();
|
89
|
//no changes to: taxonName
|
90
|
return result;
|
91
|
}
|
92
|
|
93
|
|
94
|
}
|