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
.name
;
12 import eu
.etaxonomy
.cdm
.model
.common
.RelationshipBase
;
13 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
14 import org
.apache
.log4j
.Logger
;
15 import javax
.persistence
.*;
18 * http://rs.tdwg.org/ontology/voc/TaxonName.rdf#NomenclaturalNote
21 * @created 08-Nov-2007 13:06:37
24 public class NameRelationship
extends RelationshipBase
<TaxonNameBase
, TaxonNameBase
, NameRelationshipType
> {
25 static Logger logger
= Logger
.getLogger(NameRelationship
.class);
26 //The nomenclatural code rule considered. The article/note/recommendation in the code in question that is commented on in
28 private String ruleConsidered
;
29 private NameRelationshipType type
;
31 //for hibernate, don't use
33 private NameRelationship(){
39 * creates a relationship between 2 names and adds this relationship object to the respective name relation sets
43 * @param ruleConsidered
45 protected NameRelationship(TaxonNameBase toName
, TaxonNameBase fromName
, NameRelationshipType type
, String ruleConsidered
) {
46 this(toName
, fromName
, type
, null, null, ruleConsidered
);
50 * Constructor that adds immediately a relationship instance to both
51 * Creates a relationship between 2 names and adds this relationship object to the respective name relation sets
56 * @param citationMicroReference
57 * @param ruleConsidered
59 protected NameRelationship(TaxonNameBase toName
, TaxonNameBase fromName
, NameRelationshipType type
, ReferenceBase citation
, String citationMicroReference
, String ruleConsidered
) {
60 super(fromName
, toName
, type
, citation
, citationMicroReference
);
61 this.setRuleConsidered(ruleConsidered
);
65 public TaxonNameBase
getFromName(){
66 return super.getRelatedFrom();
68 private void setFromName(TaxonNameBase fromName
){
69 super.setRelatedFrom(fromName
);
73 public TaxonNameBase
getToName(){
74 return super.getRelatedTo();
76 private void setToName(TaxonNameBase toName
){
77 super.setRelatedTo(toName
);
80 public String
getRuleConsidered(){
81 return this.ruleConsidered
;
83 private void setRuleConsidered(String ruleConsidered
){
84 this.ruleConsidered
= ruleConsidered
;