cb07a01fd813c7ce3d3065078cfb108c3c9449c9
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / media / ReferencedMedia.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.media;
11
12
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;
23
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
29 import eu.etaxonomy.cdm.model.common.IReferencedEntity;
30 import eu.etaxonomy.cdm.model.reference.ReferenceBase;
31
32 /**
33 * @author m.doering
34 * @version 1.0
35 * @created 08-Nov-2007 13:06:48
36 */
37 @XmlAccessorType(XmlAccessType.FIELD)
38 @XmlType(name = "ReferencedMedia", propOrder = {
39 "citationMicroReference",
40 "citation"
41 })
42 @XmlRootElement(name = "ReferencedMedia")
43 @Entity
44 @Audited
45 public abstract class ReferencedMedia extends Media implements IReferencedEntity {
46
47 static Logger logger = Logger.getLogger(ReferencedMedia.class);
48
49 @XmlElement(name = "CitationMicroReference")
50 private String citationMicroReference;
51
52 @XmlElement(name = "Citation")
53 @XmlIDREF
54 @XmlSchemaType(name = "IDREF")
55 @ManyToOne(fetch = FetchType.LAZY)
56 @Cascade(CascadeType.SAVE_UPDATE)
57 private ReferenceBase citation;
58
59 public ReferenceBase getCitation(){
60 return this.citation;
61 }
62
63 public void setCitation(ReferenceBase citation){
64 this.citation = citation;
65 }
66
67 public String getCitationMicroReference(){
68 return this.citationMicroReference;
69 }
70
71 public void setCitationMicroReference(String citationMicroReference){
72 this.citationMicroReference = citationMicroReference;
73 }
74
75 }