(no commit message)
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / name / HybridRelationship.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.name;
11
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.*;
16
17 /**
18 * http://rs.tdwg.org/ontology/voc/TaxonName.rdf#NomenclaturalNote
19 * @author m.doering
20 * @version 1.0
21 * @created 08-Nov-2007 13:06:26
22 */
23 @Entity
24 public class HybridRelationship extends RelationshipBase<BotanicalName, BotanicalName, HybridRelationshipType> {
25 private static final Logger logger = Logger.getLogger(HybridRelationship.class);
26 //The nomenclatural code rule considered. The article/note/recommendation in the code in question that is commented on in
27 //the note property.
28 private String ruleConsidered;
29
30 //for hibernate, don't use
31 @Deprecated
32 private HybridRelationship(){
33 super();
34 }
35
36
37 /**
38 * creates a relationship between 2 names and adds this relationship object to the respective name relation sets
39 * @param toName
40 * @param fromName
41 * @param type
42 * @param ruleConsidered
43 */
44 protected HybridRelationship(BotanicalName hybridName, BotanicalName parentName, HybridRelationshipType type, String ruleConsidered) {
45 this(parentName, hybridName, type, null, null, ruleConsidered);
46 }
47
48 /**
49 * Constructor that adds immediately a relationship instance to both
50 * Creates a relationship between 2 names and adds this relationship object to the respective name relation sets
51 * @param toName
52 * @param fromName
53 * @param type
54 * @param citation
55 * @param citationMicroReference
56 * @param ruleConsidered
57 */
58 protected HybridRelationship(BotanicalName hybridName, BotanicalName parentName, HybridRelationshipType type, ReferenceBase citation, String citationMicroReference, String ruleConsidered) {
59 super(parentName, hybridName, type, citation, citationMicroReference);
60 this.setRuleConsidered(ruleConsidered);
61 }
62
63 public BotanicalName getParentName(){
64 return super.getRelatedFrom();
65 }
66 public void setParentName(BotanicalName parentName){
67 super.setRelatedFrom(parentName);
68 }
69
70 public BotanicalName getHybridName(){
71 return super.getRelatedTo();
72 }
73 public void setHybridName(BotanicalName hybridName){
74 super.setRelatedTo(hybridName);
75 }
76
77 public String getRuleConsidered(){
78 return this.ruleConsidered;
79 }
80 public void setRuleConsidered(String ruleConsidered){
81 this.ruleConsidered = ruleConsidered;
82 }
83
84 }