updated java doc for reference interfaces
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / reference / Report.java
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.reference;
11
12
13 import javax.persistence.Entity;
14 import javax.xml.bind.annotation.XmlAccessType;
15 import javax.xml.bind.annotation.XmlAccessorType;
16 import javax.xml.bind.annotation.XmlRootElement;
17 import javax.xml.bind.annotation.XmlType;
18
19 import org.apache.log4j.Logger;
20 import org.hibernate.envers.Audited;
21 import org.hibernate.search.annotations.Indexed;
22 import org.springframework.beans.factory.annotation.Configurable;
23
24 import eu.etaxonomy.cdm.model.agent.Institution;
25 import eu.etaxonomy.cdm.strategy.cache.reference.IReferenceBaseCacheStrategy;
26 import eu.etaxonomy.cdm.strategy.cache.reference.ReferenceBaseDefaultCacheStrategy;
27
28 /**
29 * This class represents reports. A report is a document characterized by
30 * information reflective of inquiry or investigation. Reports often address
31 * questions posed by individuals in government or science and are generally
32 * elaborated within an {@link eu.etaxonomy.cdm.model.agent.Institution institution}.
33 * <P>
34 * This class corresponds, according to the TDWG ontology, to the publication type
35 * term (from PublicationTypeTerm): "Report".
36 *
37 * @author m.doering
38 * @version 1.0
39 * @created 08-Nov-2007 13:06:49
40 */
41 @XmlAccessorType(XmlAccessType.FIELD)
42 @XmlType(name = "Report", propOrder = {
43 // "institution"
44 })
45 @XmlRootElement(name = "Report")
46 @Entity
47 @Indexed(index = "eu.etaxonomy.cdm.model.reference.ReferenceBase")
48 @Audited
49 @Configurable
50 @Deprecated
51 public class Report extends PublicationBase<IReferenceBaseCacheStrategy<Report>> implements Cloneable {
52 private static final long serialVersionUID = 2224085476416095383L;
53 @SuppressWarnings("unused")
54 private static final Logger logger = Logger.getLogger(Report.class);
55
56 // @XmlElement(name = "Institution")
57 // @XmlIDREF
58 // @XmlSchemaType(name = "IDREF")
59 // @ManyToOne(fetch = FetchType.LAZY)
60 // @IndexedEmbedded
61 // @Cascade(CascadeType.SAVE_UPDATE)
62 // private Institution institution;
63
64 protected Report() {
65 super();
66 this.type = ReferenceType.Report;
67 this.cacheStrategy = new ReferenceBaseDefaultCacheStrategy<Report>();
68 }
69
70 /**
71 * Creates a new empty report instance
72 *
73 * @see #NewInstance(Institution)
74 */
75 public static Report NewInstance(){
76 Report result = new Report();
77 return result;
78 }
79
80 /**
81 * Creates a new report instance with the given {@link eu.etaxonomy.cdm.model.agent.Institution institution}.
82 *
83 * @param institution the institution where <i>this</i> report has
84 * been elaborated
85 * @see #NewInstance()
86 */
87 public static Report NewInstance(Institution institution){
88 Report result = NewInstance();
89 result.setInstitution(institution);
90 return result;
91 }
92
93
94 /**
95 * Returns the {@link eu.etaxonomy.cdm.model.agent.Institution institution} in which <i>this</i>
96 * report has been elaborated.
97 *
98 * @return the institution
99 * @see eu.etaxonomy.cdm.model.agent.Institution
100 */
101 public Institution getInstitution(){
102 return this.institution;
103 }
104
105 /**
106 * @see #getInstitution()
107 */
108 public void setInstitution(Institution institution){
109 this.institution = institution;
110 }
111
112 /**
113 * Clones <i>this</i> report instance. This is a shortcut that enables to
114 * create a new instance that differs only slightly from <i>this</i>
115 * report instance by modifying only some of the attributes.<BR>
116 * This method overrides the clone method from {@link PublicationBase PublicationBase}.
117 *
118 * @see PublicationBase#clone()
119 * @see eu.etaxonomy.cdm.model.media.IdentifiableMediaEntity#clone()
120 * @see java.lang.Object#clone()
121 */
122 @Override
123 public Report clone(){
124 Report result = (Report)super.clone();
125 //no changes to: institution
126 return result;
127 }
128
129
130 }