2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.cdm
.model
.reference
;
13 import javax
.persistence
.Entity
;
14 import javax
.persistence
.FetchType
;
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
;
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
.hibernate
.search
.annotations
.IndexedEmbedded
;
30 import org
.springframework
.beans
.factory
.annotation
.Configurable
;
32 import eu
.etaxonomy
.cdm
.model
.agent
.Institution
;
33 import eu
.etaxonomy
.cdm
.strategy
.cache
.reference
.IReferenceBaseCacheStrategy
;
34 import eu
.etaxonomy
.cdm
.strategy
.cache
.reference
.ReferenceBaseDefaultCacheStrategy
;
37 * This class represents reports. A report is a document characterized by
38 * information reflective of inquiry or investigation. Reports often address
39 * questions posed by individuals in government or science and are generally
40 * elaborated within an {@link eu.etaxonomy.cdm.model.agent.Institution institution}.
42 * This class corresponds, according to the TDWG ontology, to the publication type
43 * term (from PublicationTypeTerm): "Report".
47 * @created 08-Nov-2007 13:06:49
49 @XmlAccessorType(XmlAccessType
.FIELD
)
50 @XmlType(name
= "Report", propOrder
= {
53 @XmlRootElement(name
= "Report")
55 @Indexed(index
= "eu.etaxonomy.cdm.model.reference.ReferenceBase")
58 public class Report
extends PublicationBase
<IReferenceBaseCacheStrategy
<Report
>> implements Cloneable
{
59 private static final long serialVersionUID
= 2224085476416095383L;
60 @SuppressWarnings("unused")
61 private static final Logger logger
= Logger
.getLogger(Report
.class);
63 // @XmlElement(name = "Institution")
65 // @XmlSchemaType(name = "IDREF")
66 // @ManyToOne(fetch = FetchType.LAZY)
68 // @Cascade(CascadeType.SAVE_UPDATE)
69 // private Institution institution;
73 this.type
= ReferenceType
.Report
;
74 this.cacheStrategy
= new ReferenceBaseDefaultCacheStrategy
<Report
>();
78 * Creates a new empty report instance
80 * @see #NewInstance(Institution)
82 public static Report
NewInstance(){
83 Report result
= new Report();
88 * Creates a new report instance with the given {@link eu.etaxonomy.cdm.model.agent.Institution institution}.
90 * @param institution the institution where <i>this</i> report has
94 public static Report
NewInstance(Institution institution
){
95 Report result
= NewInstance();
96 result
.setInstitution(institution
);
102 * Returns the {@link eu.etaxonomy.cdm.model.agent.Institution institution} in which <i>this</i>
103 * report has been elaborated.
105 * @return the institution
106 * @see eu.etaxonomy.cdm.model.agent.Institution
108 public Institution
getInstitution(){
109 return this.institution
;
113 * @see #getInstitution()
115 public void setInstitution(Institution institution
){
116 this.institution
= institution
;
120 * Clones <i>this</i> report instance. This is a shortcut that enables to
121 * create a new instance that differs only slightly from <i>this</i>
122 * report instance by modifying only some of the attributes.<BR>
123 * This method overrides the clone method from {@link PublicationBase PublicationBase}.
125 * @see PublicationBase#clone()
126 * @see eu.etaxonomy.cdm.model.media.IdentifiableMediaEntity#clone()
127 * @see java.lang.Object#clone()
130 public Report
clone(){
131 Report result
= (Report
)super.clone();
132 //no changes to: institution