removed abstract method getGatheringEvent which was not implemented in DerivedUnitBase
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / occurrence / DerivedUnit.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.occurrence;
11
12
13 import org.apache.log4j.Logger;
14 import org.hibernate.envers.Audited;
15 import org.hibernate.search.annotations.Indexed;
16 import org.springframework.beans.factory.annotation.Configurable;
17
18 import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
19 import eu.etaxonomy.cdm.strategy.cache.common.IdentifiableEntityDefaultCacheStrategy;
20
21 import javax.persistence.*;
22 import javax.xml.bind.annotation.XmlAccessType;
23 import javax.xml.bind.annotation.XmlAccessorType;
24 import javax.xml.bind.annotation.XmlRootElement;
25
26 /**
27 * @author p.kelbert
28 */
29 @XmlAccessorType(XmlAccessType.FIELD)
30 @XmlRootElement(name = "DerivedUnit")
31 @Entity
32 @Indexed(index = "eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase")
33 @Audited
34 @Configurable
35 public class DerivedUnit extends DerivedUnitBase<IIdentifiableEntityCacheStrategy<DerivedUnit>> implements Cloneable{
36 /**
37 *
38 */
39 private static final long serialVersionUID = 1L;
40 private static final Logger logger = Logger.getLogger(DerivedUnit.class);
41
42 /**
43 * Factory method
44 * @return
45 */
46 public static DerivedUnit NewInstance(){
47 return new DerivedUnit();
48 }
49
50 /**
51 * Constructor
52 */
53 protected DerivedUnit() {
54 super();
55 this.cacheStrategy = new IdentifiableEntityDefaultCacheStrategy<DerivedUnit>();
56 }
57
58 //*********** CLONE **********************************/
59
60 /**
61 * Clones <i>this</i> observation. This is a shortcut that enables to
62 * create a new instance that differs only slightly from <i>this</i> observation
63 * by modifying only some of the attributes.<BR>
64 * This method overrides the clone method from {@link DerivedUnitBase DerivedUnitBase}.
65 *
66 * @see DerivedUnitBase#clone()
67 * @see eu.etaxonomy.cdm.model.media.IdentifiableMediaEntity#clone()
68 * @see java.lang.Object#clone()
69 */
70 @Override
71 public DerivedUnit clone(){
72 try{
73 DerivedUnit result = (DerivedUnit)super.clone();
74 //no changes to: -
75 return result;
76 } catch (CloneNotSupportedException e) {
77 logger.warn("Object does not implement cloneable");
78 e.printStackTrace();
79 return null;
80 }
81 }
82
83
84 }