Some bug fixes
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / common / AnnotationType.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.common;
11
12
13 import org.apache.log4j.Logger;
14
15 import java.util.*;
16
17 import javax.persistence.*;
18 import javax.xml.bind.annotation.XmlAccessType;
19 import javax.xml.bind.annotation.XmlAccessorType;
20 import javax.xml.bind.annotation.XmlRootElement;
21 import javax.xml.bind.annotation.XmlType;
22
23 /**
24 * Annotation types ...
25 * @author a.mueller
26 * @version 1.0
27 * @created 12-Nov-2008 15:37:33
28 */
29 @XmlAccessorType(XmlAccessType.FIELD)
30 @XmlType(name = "AnnotationType")
31 @XmlRootElement(name = "AnnotationType")
32 @Entity
33 public class AnnotationType extends DefinedTermBase {
34 public static final Logger logger = Logger.getLogger(AnnotationType.class);
35
36 private static final UUID uuidTechnical = UUID.fromString("6a5f9ea4-1bdd-4906-89ad-6e669f982d69");
37 private static final UUID uuidEditorial = UUID.fromString("34204192-b41d-4857-a1d4-28992bef2a2a");
38
39 public static AnnotationType NewInstance(String term, String label, String labelAbbrev){
40 return new AnnotationType(term, label, labelAbbrev);
41 }
42
43 /**
44 * Constructor
45 * @param term
46 * @param label
47 */
48 public AnnotationType() {
49 super();
50 }
51
52 /**
53 * Constructor
54 * @param term
55 * @param label
56 */
57 protected AnnotationType(String term, String label, String labelAbbrev) {
58 super(term, label, labelAbbrev);
59 }
60
61
62 public static final AnnotationType getByUuid(UUID uuid){
63 return (AnnotationType) findByUuid(uuid);
64 }
65
66
67 public static final AnnotationType TECHNICAL(){
68 return getByUuid(uuidTechnical);
69 }
70
71 public static final AnnotationType EDITORIAL(){
72 return getByUuid(uuidEditorial);
73 }
74
75 }