updated java doc for reference interfaces
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / reference / Report.java
index cf6f0086a1f84a9ef8936badf469bb5d19b8870c..6413f4ed9d97f3396302f02fa82bc86b4366d96a 100644 (file)
@@ -11,30 +11,79 @@ package eu.etaxonomy.cdm.model.reference;
 
 
 import javax.persistence.Entity;
-import javax.persistence.ManyToOne;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
 
 import org.apache.log4j.Logger;
-import org.hibernate.annotations.Cascade;
-import org.hibernate.annotations.CascadeType;
+import org.hibernate.envers.Audited;
+import org.hibernate.search.annotations.Indexed;
+import org.springframework.beans.factory.annotation.Configurable;
 
 import eu.etaxonomy.cdm.model.agent.Institution;
+import eu.etaxonomy.cdm.strategy.cache.reference.IReferenceBaseCacheStrategy;
+import eu.etaxonomy.cdm.strategy.cache.reference.ReferenceBaseDefaultCacheStrategy;
 
 /**
- * publisher is "institution" in BibTex ???
+ * This class represents reports. A report is a document characterized by 
+ * information reflective of inquiry or investigation. Reports often address
+ * questions posed by individuals in government or science and are generally
+ * elaborated within an {@link eu.etaxonomy.cdm.model.agent.Institution institution}.
+ * <P>
+ * This class corresponds, according to the TDWG ontology, to the publication type
+ * term (from PublicationTypeTerm): "Report".
+ * 
  * @author m.doering
  * @version 1.0
  * @created 08-Nov-2007 13:06:49
  */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "Report", propOrder = {
+//    "institution"
+})
+@XmlRootElement(name = "Report")
 @Entity
-public class Report extends PublicationBase {
-       static Logger logger = Logger.getLogger(Report.class);
-       private Institution institution;
+@Indexed(index = "eu.etaxonomy.cdm.model.reference.ReferenceBase")
+@Audited
+@Configurable
+@Deprecated
+public class Report extends PublicationBase<IReferenceBaseCacheStrategy<Report>> implements Cloneable {
+       private static final long serialVersionUID = 2224085476416095383L;
+       @SuppressWarnings("unused")
+       private static final Logger logger = Logger.getLogger(Report.class);
+       
+//     @XmlElement(name = "Institution")
+//     @XmlIDREF
+//     @XmlSchemaType(name = "IDREF")
+//     @ManyToOne(fetch = FetchType.LAZY)
+//     @IndexedEmbedded
+//     @Cascade(CascadeType.SAVE_UPDATE)
+//     private Institution institution;
 
+       protected Report() {
+               super();
+               this.type = ReferenceType.Report;
+               this.cacheStrategy = new ReferenceBaseDefaultCacheStrategy<Report>();
+       }
+       
+       /** 
+        * Creates a new empty report instance
+        * 
+        * @see #NewInstance(Institution)
+        */
        public static Report NewInstance(){
                Report result = new Report();
                return result;
        }
        
+       /** 
+        * Creates a new report instance with the given {@link eu.etaxonomy.cdm.model.agent.Institution institution}.
+        * 
+        * @param       institution             the institution where <i>this</i> report has
+        *                                                      been elaborated
+        * @see                                         #NewInstance()
+        */
        public static Report NewInstance(Institution institution){
                Report result = NewInstance();
                result.setInstitution(institution);
@@ -42,18 +91,40 @@ public class Report extends PublicationBase {
        }
        
        
-       @ManyToOne
-       @Cascade({CascadeType.SAVE_UPDATE})
+       /**
+        * Returns the {@link eu.etaxonomy.cdm.model.agent.Institution institution} in which <i>this</i>
+        * report has been elaborated.
+        * 
+        * @return  the institution
+        * @see         eu.etaxonomy.cdm.model.agent.Institution
+        */
        public Institution getInstitution(){
                return this.institution;
        }
+       
+       /**
+        * @see #getInstitution()
+        */
        public void setInstitution(Institution institution){
                this.institution = institution;
        }
-
+       
+       /** 
+        * Clones <i>this</i> report instance. This is a shortcut that enables to
+        * create a new instance that differs only slightly from <i>this</i>
+        * report instance by modifying only some of the attributes.<BR>
+        * This method overrides the clone method from {@link PublicationBase PublicationBase}.
+        * 
+        * @see PublicationBase#clone()
+        * @see eu.etaxonomy.cdm.model.media.IdentifiableMediaEntity#clone()
+        * @see java.lang.Object#clone()
+        */
        @Override
-       public String generateTitle(){
-               return "";
+       public Report clone(){
+               Report result = (Report)super.clone();
+               //no changes to: institution
+               return result;
        }
 
+
 }
\ No newline at end of file