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.persistence.FetchType;
|
14
|
import javax.persistence.JoinColumn;
|
15
|
import javax.persistence.ManyToOne;
|
16
|
import javax.xml.bind.annotation.XmlAccessType;
|
17
|
import javax.xml.bind.annotation.XmlAccessorType;
|
18
|
import javax.xml.bind.annotation.XmlElement;
|
19
|
import javax.xml.bind.annotation.XmlIDREF;
|
20
|
import javax.xml.bind.annotation.XmlRootElement;
|
21
|
import javax.xml.bind.annotation.XmlSchemaType;
|
22
|
import javax.xml.bind.annotation.XmlType;
|
23
|
|
24
|
import org.apache.log4j.Logger;
|
25
|
import org.hibernate.annotations.Cascade;
|
26
|
import org.hibernate.annotations.CascadeType;
|
27
|
import org.hibernate.envers.Audited;
|
28
|
import org.hibernate.search.annotations.Indexed;
|
29
|
import org.springframework.beans.factory.annotation.Configurable;
|
30
|
|
31
|
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
|
32
|
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
33
|
import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
|
34
|
import eu.etaxonomy.cdm.strategy.cache.common.IdentifiableEntityDefaultCacheStrategy;
|
35
|
|
36
|
/**
|
37
|
* This class represents all piece of information (not ruled by a {@link NomenclaturalCode nomenclatural code})
|
38
|
* concerning a {@link TaxonNameBase taxon name} like for instance the content of its first
|
39
|
* publication (protolog) or a picture of this publication.
|
40
|
*
|
41
|
* @author a.mueller
|
42
|
* @version 1.0
|
43
|
* @created 08-Jul-2008
|
44
|
*/
|
45
|
@XmlAccessorType(XmlAccessType.FIELD)
|
46
|
@XmlType(name = "TaxonNameDescription", propOrder = {
|
47
|
"taxonName"
|
48
|
})
|
49
|
@XmlRootElement(name = "TaxonNameDescription")
|
50
|
@Entity
|
51
|
@Indexed(index = "eu.etaxonomy.cdm.model.description.DescriptionBase")
|
52
|
@Audited
|
53
|
@Configurable
|
54
|
public class TaxonNameDescription extends DescriptionBase<IIdentifiableEntityCacheStrategy<TaxonNameDescription>> {
|
55
|
private static final long serialVersionUID = -7349160369642038687L;
|
56
|
@SuppressWarnings("unused")
|
57
|
private static final Logger logger = Logger.getLogger(TaxonNameDescription.class);
|
58
|
|
59
|
@XmlElement(name="TaxonName")
|
60
|
@XmlIDREF
|
61
|
@XmlSchemaType(name="IDREF")
|
62
|
@ManyToOne(fetch = FetchType.LAZY)
|
63
|
@JoinColumn(name="taxonName_fk")
|
64
|
@Cascade(CascadeType.SAVE_UPDATE)
|
65
|
private TaxonNameBase<?,?> taxonName;
|
66
|
|
67
|
/**
|
68
|
* Class constructor: creates a new empty taxon name description instance.
|
69
|
*/
|
70
|
public TaxonNameDescription() {
|
71
|
super();
|
72
|
this.cacheStrategy = new IdentifiableEntityDefaultCacheStrategy();
|
73
|
}
|
74
|
|
75
|
/**
|
76
|
* Creates a new empty taxon name description instance.
|
77
|
*/
|
78
|
public static TaxonNameDescription NewInstance(){
|
79
|
return new TaxonNameDescription();
|
80
|
}
|
81
|
|
82
|
/**
|
83
|
* Returns the {@link TaxonNameBase taxon name} to which <i>this</i> taxon name description
|
84
|
* provides additional information not ruled by a {@link NomenclaturalCode nomenclatural code}.
|
85
|
*/
|
86
|
public TaxonNameBase<?,?> getTaxonName() {
|
87
|
return taxonName;
|
88
|
}
|
89
|
}
|