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 org.hibernate.envers.Audited;
|
14
|
import org.hibernate.search.annotations.Indexed;
|
15
|
import org.springframework.beans.factory.annotation.Configurable;
|
16
|
|
17
|
import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
|
18
|
import eu.etaxonomy.cdm.strategy.cache.common.IdentifiableEntityDefaultCacheStrategy;
|
19
|
|
20
|
import javax.persistence.*;
|
21
|
import javax.xml.bind.annotation.XmlAccessType;
|
22
|
import javax.xml.bind.annotation.XmlAccessorType;
|
23
|
import javax.xml.bind.annotation.XmlRootElement;
|
24
|
import javax.xml.bind.annotation.XmlType;
|
25
|
|
26
|
/**
|
27
|
* @author m.doering
|
28
|
* @version 1.0
|
29
|
* @created 08-Nov-2007 13:06:32
|
30
|
*/
|
31
|
@XmlAccessorType(XmlAccessType.FIELD)
|
32
|
@XmlType(name = "LivingBeing", propOrder = {
|
33
|
})
|
34
|
@XmlRootElement(name = "LivingBeing")
|
35
|
@Entity
|
36
|
@Indexed(index = "eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase")
|
37
|
@Audited
|
38
|
@Configurable
|
39
|
public class LivingBeing extends DerivedUnitBase<IIdentifiableEntityCacheStrategy<LivingBeing>> implements Cloneable {
|
40
|
private static final Logger logger = Logger.getLogger(LivingBeing.class);
|
41
|
|
42
|
/**
|
43
|
* Factory method
|
44
|
* @return
|
45
|
*/
|
46
|
public static LivingBeing NewInstance(){
|
47
|
return new LivingBeing();
|
48
|
}
|
49
|
|
50
|
/**
|
51
|
* Constructor
|
52
|
*/
|
53
|
protected LivingBeing() {
|
54
|
super();
|
55
|
this.cacheStrategy = new IdentifiableEntityDefaultCacheStrategy<LivingBeing>();
|
56
|
}
|
57
|
|
58
|
//*********** CLONE **********************************/
|
59
|
|
60
|
/**
|
61
|
* Clones <i>this</i> living beeing. This is a shortcut that enables to
|
62
|
* create a new instance that differs only slightly from <i>this</i> living beeing
|
63
|
* by modifying only some of the attributes.<BR>
|
64
|
* This method overrides the clone method from {@link DerivedUnitBase DerivedUnitBase}.
|
65
|
*
|
66
|
* @see DerivedUnitBase#clone()
|
67
|
* @see eu.etaxonomy.cdm.model.media.IdentifiableMediaEntity#clone()
|
68
|
* @see java.lang.Object#clone()
|
69
|
*/
|
70
|
@Override
|
71
|
public LivingBeing clone(){
|
72
|
try{
|
73
|
LivingBeing result = (LivingBeing)super.clone();
|
74
|
//no changes to: -
|
75
|
return result;
|
76
|
} catch (CloneNotSupportedException e) {
|
77
|
logger.warn("Object does not implement cloneable");
|
78
|
e.printStackTrace();
|
79
|
return null;
|
80
|
}
|
81
|
}
|
82
|
|
83
|
}
|