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
;
12 import javax
.persistence
.Entity
;
13 import javax
.xml
.bind
.annotation
.XmlAccessType
;
14 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
15 import javax
.xml
.bind
.annotation
.XmlElement
;
16 import javax
.xml
.bind
.annotation
.XmlRootElement
;
17 import javax
.xml
.bind
.annotation
.XmlType
;
19 import org
.apache
.log4j
.Logger
;
20 import org
.hibernate
.envers
.Audited
;
21 import org
.hibernate
.search
.annotations
.Indexed
;
23 import eu
.etaxonomy
.cdm
.strategy
.cache
.reference
.IReferenceBaseCacheStrategy
;
26 * This (abstract) class represents all different kind of published {@link StrictReferenceBase references}
27 * which constitute a physical or virtual unit. A reference is a published
28 * reference if it can be consulted by the general public.
32 * @created 08-Nov-2007 13:06:46
34 @XmlAccessorType(XmlAccessType
.FIELD
)
35 @XmlType(name
= "PublicationBase", propOrder
= {
40 @XmlRootElement(name
= "PublicationBase")
42 @Indexed(index
= "eu.etaxonomy.cdm.model.reference.ReferenceBase")
44 public abstract class PublicationBase
<S
extends IReferenceBaseCacheStrategy
> extends StrictReferenceBase
<S
> {
45 private static final Logger logger
= Logger
.getLogger(PublicationBase
.class);
47 // @XmlElementWrapper(name = "Publishers")
48 // @XmlElement(name = "Publisher")
49 // @OneToMany (cascade = {javax.persistence.CascadeType.ALL}, fetch= FetchType.LAZY)
50 // @IndexColumn(name="sortIndex", base = 0)
51 // @JoinColumn (name = "referenceBase_id")
52 // @Cascade({CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE_ORPHAN})
53 // private List<Publisher> publishers = new ArrayList<Publisher>();
56 @XmlElement(name
= "Publisher")
57 private String publisher
;
59 @XmlElement(name
= "PlacePublished")
60 private String placePublished
;
63 public PublicationBase(){
69 * @return the publisher
71 public String
getPublisher() {
78 * @param publisher the publisher to set
80 public void setPublisher(String publisher
) {
81 this.publisher
= publisher
;
87 * @return the placePublished
89 public String
getPlacePublished() {
90 return placePublished
;
96 * @param placePublished the placePublished to set
98 public void setPlacePublished(String placePublished
) {
99 this.placePublished
= placePublished
;
103 //*********** CLONE **********************************/
106 * Clones <i>this</i> publication. This is a shortcut that enables to
107 * create a new instance that differs only slightly from <i>this</i>
108 * publication by modifying only some of the attributes.<BR>
109 * This method overrides the clone method from {@link StrictReferenceBase StrictReferenceBase}.
111 * @see StrictReferenceBase#clone()
112 * @see eu.etaxonomy.cdm.model.media.IdentifiableMediaEntity#clone()
113 * @see java.lang.Object#clone()
116 public Object
clone() {
117 PublicationBase result
= (PublicationBase
)super.clone();
119 // result.publishers = new ArrayList<Publisher>();
120 // for (Publisher publisher : this.publishers ){
121 // Publisher newPublisher;
123 // newPublisher = (Publisher)publisher.clone();
124 // } catch (CloneNotSupportedException e) {
125 // //Publisher implements Cloneable therefore this should not be reached
126 // throw new RuntimeException("Publisher does not implement Cloneable");
128 // result.addPublisher(newPublisher.getPublisherName(), newPublisher.getPlace());