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