Project

General

Profile

Download (1.71 KB) Statistics
| Branch: | Tag: | Revision:
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 javax.persistence.*;
15
import javax.xml.bind.annotation.XmlAccessType;
16
import javax.xml.bind.annotation.XmlAccessorType;
17
import javax.xml.bind.annotation.XmlRootElement;
18

    
19
/**
20
 * @author p.kelbert
21
 */
22
@XmlAccessorType(XmlAccessType.FIELD)
23
@XmlRootElement(name = "DerivedUnit")
24
@Entity
25
public class DerivedUnit extends DerivedUnitBase implements Cloneable{
26
	private static final Logger logger = Logger.getLogger(DerivedUnit.class);
27
	
28
	/**
29
	 * Factory method
30
	 * @return
31
	 */
32
	public static DerivedUnit NewInstance(){
33
		return new DerivedUnit();
34
	}
35
	
36
	/**
37
	 * Constructor
38
	 */
39
	protected DerivedUnit() {
40
		super();
41
	}
42
	
43
//*********** CLONE **********************************/	
44
	
45
	/** 
46
	 * Clones <i>this</i> observation. This is a shortcut that enables to
47
	 * create a new instance that differs only slightly from <i>this</i> observation
48
	 * by modifying only some of the attributes.<BR>
49
	 * This method overrides the clone method from {@link DerivedUnitBase DerivedUnitBase}.
50
	 * 
51
	 * @see DerivedUnitBase#clone()
52
	 * @see eu.etaxonomy.cdm.model.media.IdentifiableMediaEntity#clone()
53
	 * @see java.lang.Object#clone()
54
	 */
55
	@Override
56
	public DerivedUnit clone(){
57
		try{
58
			DerivedUnit result = (DerivedUnit)super.clone();
59
			//no changes to: -
60
			return result;
61
		} catch (CloneNotSupportedException e) {
62
			logger.warn("Object does not implement cloneable");
63
			e.printStackTrace();
64
			return null;
65
		}
66
	}
67

    
68
	
69
}
(4-4/16)