X-Git-Url: https://dev.e-taxonomy.eu/gitweb/cdmlib.git/blobdiff_plain/33fe95bfffee62892c25189b21d49c977992cb4c..57606ee3dcf9db7efd1b7a5220ad8d53f4200d97:/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/Report.java diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/Report.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/Report.java index d4f2a2bfda..c977e5efd1 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/Report.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/Report.java @@ -11,19 +11,33 @@ package eu.etaxonomy.cdm.model.reference; import javax.persistence.Entity; +import javax.persistence.FetchType; import javax.persistence.ManyToOne; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +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.hibernate.search.annotations.IndexedEmbedded; +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; /** * 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 agent.Institution institution}. + * elaborated within an {@link eu.etaxonomy.cdm.model.agent.Institution institution}. *

* This class corresponds, according to the TDWG ontology, to the publication type * term (from PublicationTypeTerm): "Report". @@ -32,11 +46,34 @@ import eu.etaxonomy.cdm.model.agent.Institution; * @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 +public class Report extends PublicationBase> 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(); + } + /** * Creates a new empty report instance * @@ -48,7 +85,7 @@ public class Report extends PublicationBase { } /** - * Creates a new report instance with the given {@link agent.Institution institution}. + * Creates a new report instance with the given {@link eu.etaxonomy.cdm.model.agent.Institution institution}. * * @param institution the institution where this report has * been elaborated @@ -62,42 +99,39 @@ public class Report extends PublicationBase { /** - * Returns the {@link agent.Institution institution} in which this + * Returns the {@link eu.etaxonomy.cdm.model.agent.Institution institution} in which this * report has been elaborated. * * @return the institution - * @see agent.Institution + * @see eu.etaxonomy.cdm.model.agent.Institution */ - @ManyToOne - @Cascade({CascadeType.SAVE_UPDATE}) public Institution getInstitution(){ return this.institution; } + /** * @see #getInstitution() */ public void setInstitution(Institution institution){ this.institution = institution; } - - /** - * Generates, according to the {@link strategy.cache.reference.IReferenceBaseCacheStrategy cache strategy} - * assigned to this report, a string that identifies this - * report and returns it. This string may be stored in the inherited - * {@link common.IdentifiableEntity#getTitleCache() titleCache} attribute.
- * This method overrides the generic and inherited - * ReferenceBase#generateTitle() method. - * - * @return the string identifying this report - * @see ReferenceBase#generateTitle() - * @see common.IdentifiableEntity#getTitleCache() - * @see common.IdentifiableEntity#generateTitle() - * @see strategy.cache.common.IIdentifiableEntityCacheStrategy#getTitleCache() + + /** + * Clones this report instance. This is a shortcut that enables to + * create a new instance that differs only slightly from this + * report instance by modifying only some of the attributes.
+ * 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(){ - //TODO is this method really needed or is ReferenceBase#generateTitle() enough? - return ""; + public Report clone(){ + Report result = (Report)super.clone(); + //no changes to: institution + return result; } + } \ No newline at end of file