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
;
12 import javax
.persistence
.MappedSuperclass
;
13 import javax
.persistence
.Transient
;
14 import javax
.persistence
.FetchType
;
15 import javax
.persistence
.ManyToOne
;
16 import javax
.persistence
.MappedSuperclass
;
17 import javax
.xml
.bind
.annotation
.XmlAccessType
;
18 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
19 import javax
.xml
.bind
.annotation
.XmlRootElement
;
20 import javax
.xml
.bind
.annotation
.XmlType
;
22 import org
.apache
.log4j
.Logger
;
24 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
26 import org
.apache
.log4j
.Logger
;
27 import org
.hibernate
.annotations
.Cascade
;
28 import org
.hibernate
.annotations
.CascadeType
;
30 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
31 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
36 @XmlAccessorType(XmlAccessType
.FIELD
)
37 @XmlType(name
= "RelationshipBase", propOrder
= { })
38 @XmlRootElement(name
= "RelationshipBase")
40 public abstract class RelationshipBase
<FROM
extends IRelated
, TO
extends IRelated
, TYPE
extends RelationshipTermBase
> extends ReferencedEntityBase
{
41 private static final long serialVersionUID
= -5030154633820061997L;
42 static Logger logger
= Logger
.getLogger(RelationshipBase
.class);
44 protected RelationshipBase(){
49 * Creates a relationship between 2 objects and adds it to the respective
50 * relation sets of both objects.
56 * @param citationMicroReference
58 protected RelationshipBase(FROM from
, TO to
, TYPE type
, ReferenceBase citation
, String citationMicroReference
) {
59 super(citation
, citationMicroReference
, null);
63 from
.addRelationship(this);
64 to
.addRelationship(this);
68 public abstract TYPE
getType();
70 protected abstract void setType(TYPE type
);
73 protected abstract FROM
getRelatedFrom();
75 protected abstract void setRelatedFrom(FROM relatedFrom
);
78 protected abstract TO
getRelatedTo();
80 protected abstract void setRelatedTo(TO relatedTo
);
87 // public UUID getToUuidCache(){
88 // return relationTo.getUuid();
90 // protected void setToUuid(UUID uuid){
94 // public UUID getFromUuid(){
95 // return relationTo.getUuid();
97 // protected void setFromUuid(UUID uuid){