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.
9 package eu
.etaxonomy
.cdm
.model
.molecular
;
11 import javax
.persistence
.Column
;
12 import javax
.persistence
.Entity
;
13 import javax
.persistence
.FetchType
;
14 import javax
.persistence
.ManyToOne
;
15 import javax
.xml
.bind
.annotation
.XmlAccessType
;
16 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
17 import javax
.xml
.bind
.annotation
.XmlElement
;
18 import javax
.xml
.bind
.annotation
.XmlIDREF
;
19 import javax
.xml
.bind
.annotation
.XmlRootElement
;
20 import javax
.xml
.bind
.annotation
.XmlSchemaType
;
21 import javax
.xml
.bind
.annotation
.XmlType
;
23 import org
.apache
.log4j
.Logger
;
24 import org
.hibernate
.envers
.Audited
;
25 import org
.hibernate
.search
.annotations
.Field
;
27 import eu
.etaxonomy
.cdm
.model
.common
.EventBase
;
28 import eu
.etaxonomy
.cdm
.model
.occurrence
.MaterialOrMethodEvent
;
29 import eu
.etaxonomy
.cdm
.model
.term
.DefinedTerm
;
32 * Cloning is a method used in {@link Amplification DNA amplification} for multiplying the base
33 * material. Various cloning methods exist. Classical cloning methods use bacteria for cloning
34 * while the latest approaches use other techniques.
40 @XmlAccessorType(XmlAccessType
.FIELD
)
41 @XmlType(name
= "Cloning", propOrder
= {
46 @XmlRootElement(name
= "Cloning")
49 public class Cloning
extends MaterialOrMethodEvent
implements Cloneable
{
50 private static final long serialVersionUID
= 6179007910988646989L;
51 @SuppressWarnings("unused")
52 private static final Logger logger
= Logger
.getLogger(Cloning
.class);
54 /** @see #getStrain() */
55 @XmlElement(name
= "strain")
58 private String strain
;
60 /** @see #getForwardPrimer() */
61 @XmlElement(name
= "ForwardPrimer")
63 @XmlSchemaType(name
= "IDREF")
64 @ManyToOne(fetch
=FetchType
.LAZY
)
65 private Primer forwardPrimer
;
67 /** @see #getReversePrimer()*/
68 @XmlElement(name
= "ReversePrimer")
70 @XmlSchemaType(name
= "IDREF")
71 @ManyToOne(fetch
=FetchType
.LAZY
)
72 private Primer reversePrimer
;
75 // ******************** FACTORY METHOD ******************/
77 public static Cloning
NewInstance(){
81 public static Cloning
NewInstance(DefinedTerm definedMaterialOrMethod
, String methodText
, String strain
, Primer forwardPrimer
, Primer reversePrimer
){
82 return new Cloning(definedMaterialOrMethod
, methodText
, strain
, forwardPrimer
, reversePrimer
);
85 // ********************* CONSTRUCTOR ********************/
88 //made protected to fix a java.lang.InstantiationException which occurred while loading
89 //see https://stackoverflow.com/questions/7273125/hibernate-envers-and-javassist-enhancement-failed-exception
90 protected Cloning(){};
91 protected Cloning(DefinedTerm definedMaterialOrMethod
, String methodText
, String strain
, Primer forwardPrimer
, Primer reversePrimer
){
92 super(definedMaterialOrMethod
, methodText
);
94 this.forwardPrimer
= forwardPrimer
;
95 this.reversePrimer
= reversePrimer
;
98 // ********************* GETTER / SETTER ********************/
102 * The primer used for forward cloning.
103 * @see #getReversePrimer()
105 public Primer
getForwardPrimer() {
106 return forwardPrimer
;
110 * @see #getForwardPrimer()
111 * @see #getReversePrimer()
113 public void setForwardPrimer(Primer forwardPrimer
) {
114 this.forwardPrimer
= forwardPrimer
;
118 * The primer used for reverse cloning.
119 * @see #getForwardPrimer()
121 public Primer
getReversePrimer() {
122 return reversePrimer
;
126 * @see #getReversePrimer()
127 * @see #getForwardPrimer()
129 public void setReversePrimer(Primer reversePrimer
) {
130 this.reversePrimer
= reversePrimer
;
133 public String
getStrain() {
137 public void setStrain(String strain
) {
138 this.strain
= strain
;
141 // ********************* CLONE ********************/
143 * Clones <i>this</i> {@link Cloning}. This is a shortcut that enables to create
144 * a new instance that differs only slightly from <i>this</i> cloning by
145 * modifying only some of the attributes.<BR><BR>
148 * @see EventBase#clone()
149 * @see java.lang.Object#clone()
152 public Object
clone() {
153 Cloning result
= (Cloning
)super.clone();
155 //don't change strain, forwardPrimer, backwardPrimer