(no commit message)
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / common / Extension.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 import javax.persistence.*;
17
18 /**
19 * This class aims to make available more "attributes" for identifiable entities
20 * in a flexible way. Application developers (and even users) can define their own
21 * "attributes" as an ExtensionType and add data to Identifiable instances via
22 * Extension instances.
23 * @author m.doering
24 * @version 1.0
25 * @created 08-Nov-2007 13:06:23
26 */
27 @Entity
28 public class Extension extends VersionableEntity {
29 static Logger logger = Logger.getLogger(Extension.class);
30 private String value;
31 private ExtensionType type;
32 private IdentifiableEntity extendedObj;
33
34 @Transient
35 public IdentifiableEntity getExtendedObj() {
36 return extendedObj;
37 }
38 public void setExtendedObj(IdentifiableEntity extendedObj) {
39 this.extendedObj = extendedObj;
40 }
41
42 @ManyToOne
43 public ExtensionType getType(){
44 return this.type;
45 }
46
47 /**
48 *
49 * @param type type
50 */
51 public void setType(ExtensionType type){
52 this.type = type;
53 }
54
55 public String getValue(){
56 return this.value;
57 }
58
59 /**
60 *
61 * @param value value
62 */
63 public void setValue(String value){
64 this.value = value;
65 }
66
67 }