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.JoinColumn;
|
14
|
import javax.persistence.ManyToOne;
|
15
|
import javax.xml.bind.annotation.XmlAccessType;
|
16
|
import javax.xml.bind.annotation.XmlAccessorType;
|
17
|
import javax.xml.bind.annotation.XmlTransient;
|
18
|
import javax.xml.bind.annotation.XmlType;
|
19
|
|
20
|
import org.apache.log4j.Logger;
|
21
|
import org.hibernate.annotations.Cascade;
|
22
|
import org.hibernate.annotations.CascadeType;
|
23
|
|
24
|
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
25
|
|
26
|
/**
|
27
|
* This class represents all piece of information (not ruled by a {@link NomenclaturalCode nomenclatural code})
|
28
|
* concerning a {@link TaxonNameBase taxon name} like for instance the content of its first
|
29
|
* publication (protolog) or a picture of this publication.
|
30
|
*
|
31
|
* @author a.mueller
|
32
|
* @version 1.0
|
33
|
* @created 08-Jul-2008
|
34
|
*/
|
35
|
@XmlAccessorType(XmlAccessType.FIELD)
|
36
|
@XmlType(name = "TaxonNameDescription", propOrder = {
|
37
|
})
|
38
|
@Entity
|
39
|
public class TaxonNameDescription extends DescriptionBase {
|
40
|
static Logger logger = Logger.getLogger(TaxonNameDescription.class);
|
41
|
|
42
|
@XmlTransient
|
43
|
private TaxonNameBase taxonName;
|
44
|
|
45
|
|
46
|
/**
|
47
|
* Class constructor: creates a new empty taxon name description instance.
|
48
|
*/
|
49
|
public TaxonNameDescription() {
|
50
|
super();
|
51
|
}
|
52
|
|
53
|
|
54
|
/**
|
55
|
* Creates a new empty taxon name description instance.
|
56
|
*/
|
57
|
public static TaxonNameDescription NewInstance(){
|
58
|
return new TaxonNameDescription();
|
59
|
}
|
60
|
|
61
|
/**
|
62
|
* Returns the {@link TaxonNameBase taxon name} to which <i>this</i> taxon name description
|
63
|
* provides additional information not ruled by a {@link NomenclaturalCode nomenclatural code}.
|
64
|
*/
|
65
|
@ManyToOne
|
66
|
@JoinColumn(name="taxonName_fk")
|
67
|
@Cascade(CascadeType.SAVE_UPDATE)
|
68
|
public TaxonNameBase getTaxonName() {
|
69
|
return taxonName;
|
70
|
}
|
71
|
@Deprecated //for hibernate use only, use taxonName.addDescription() instead
|
72
|
protected void setTaxonName(TaxonNameBase taxonName) {
|
73
|
this.taxonName = taxonName;
|
74
|
}
|
75
|
|
76
|
|
77
|
}
|