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
.common
;
13 import javax
.persistence
.Column
;
14 import javax
.persistence
.Entity
;
15 import javax
.persistence
.FetchType
;
16 import javax
.persistence
.Inheritance
;
17 import javax
.persistence
.InheritanceType
;
18 import javax
.persistence
.JoinColumn
;
19 import javax
.xml
.bind
.annotation
.XmlAccessType
;
20 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
21 import javax
.xml
.bind
.annotation
.XmlElement
;
22 import javax
.xml
.bind
.annotation
.XmlIDREF
;
23 import javax
.xml
.bind
.annotation
.XmlRootElement
;
24 import javax
.xml
.bind
.annotation
.XmlSchemaType
;
25 import javax
.xml
.bind
.annotation
.XmlType
;
27 import org
.apache
.commons
.lang
.StringUtils
;
28 import org
.apache
.log4j
.Logger
;
29 import org
.hibernate
.annotations
.Any
;
30 import org
.hibernate
.annotations
.Table
;
31 import org
.hibernate
.envers
.Audited
;
32 import org
.hibernate
.envers
.NotAudited
;
34 import eu
.etaxonomy
.cdm
.common
.CdmUtils
;
37 * Abstract base class for classes implementing {@link eu.etaxonomy.cdm.model.common.IOriginalSource IOriginalSource}.
38 * @see eu.etaxonomy.cdm.model.common.IOriginalSource
42 * @created 08-Nov-2007 13:06:22
45 @XmlAccessorType(XmlAccessType
.FIELD
)
46 @XmlType(name
= "OriginalSource", propOrder
= {
50 @XmlRootElement(name
= "OriginalSource")
53 @Inheritance(strategy
=InheritanceType
.SINGLE_TABLE
)
54 @Table(appliesTo
="OriginalSourceBase")
55 public abstract class OriginalSourceBase
<T
extends ISourceable
> extends ReferencedEntityBase
implements Cloneable
, IOriginalSource
<T
> {
56 private static final long serialVersionUID
= -1972959999261181462L;
57 @SuppressWarnings("unused")
58 private static final Logger logger
= Logger
.getLogger(OriginalSourceBase
.class);
60 //The object's ID in the source, where the alternative string comes from
61 @XmlElement(name
= "IdInSource")
62 private String idInSource
;
64 @XmlElement(name
= "IdNamespace")
65 private String idNamespace
;
70 protected OriginalSourceBase(){
75 * @see eu.etaxonomy.cdm.model.common.IOriginalSource#getIdInSource()
77 public String
getIdInSource(){
78 return this.idInSource
;
81 * @see eu.etaxonomy.cdm.model.common.IOriginalSource#setIdInSource(java.lang.String)
83 public void setIdInSource(String idInSource
){
84 this.idInSource
= idInSource
;
89 * @see eu.etaxonomy.cdm.model.common.IOriginalSource#getIdNamespace()
91 public String
getIdNamespace() {
96 * @see eu.etaxonomy.cdm.model.common.IOriginalSource#setIdNamespace(java.lang.String)
98 public void setIdNamespace(String idNamespace
) {
99 this.idNamespace
= idNamespace
;
103 //********************** CLONE ************************************************/
106 * @see java.lang.Object#clone()
109 public Object
clone() throws CloneNotSupportedException
{
110 OriginalSourceBase result
= (OriginalSourceBase
)super.clone();
112 //no changes to: idInSource, sourcedObj
117 //************************ toString ***************************************/
119 public String
toString(){
120 if (StringUtils
.isNotBlank(idInSource
) || StringUtils
.isNotBlank(idNamespace
) ){
121 return "OriginalSource:" + CdmUtils
.concat(":", idNamespace
, idInSource
);
123 return super.toString();