@Entity annotation for CdmMetaData
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / common / CdmMetaData.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10
11 package eu.etaxonomy.cdm.model.common;
12
13 import java.util.ArrayList;
14 import java.util.List;
15
16 import javax.persistence.Entity;
17
18 import org.apache.log4j.Logger;
19
20 /**
21 * @author a.mueller
22 * @created 07.09.2009
23 * @version 1.0
24 */
25 @Entity
26 public class CdmMetaData {
27 @SuppressWarnings("unused")
28 private static final Logger logger = Logger.getLogger(CdmMetaData.class);
29
30 /**
31 * The database schema version number.
32 * It is recommended to have the first two numbers equal to the CDM Library version number.
33 * But it is not obligatory as there may be cases when the library number changes but the
34 * schema version is not changing.
35 * The third should be incremented if the schema changes in a way that SCHEMA_VALIDATION.UPDATE
36 * will probably not work or will not be enough to transform old data into new data.
37 * The fourth number shoud be incremented when minor schema changes take place that can
38 * be handled by SCHEMA_VALIDATION.UPDATE
39 * The last number represents the date of change.
40 */
41 private static final String dbSchemaVersion = "2.1.0.0.200909071123";
42
43 public enum MetaDataPropertyName{
44 DB_SCHEMA_VERSION
45 }
46
47 private MetaDataPropertyName propertyName;
48 private String value;
49
50 public static final List<CdmMetaData> propertyList(){
51 List<CdmMetaData> result = new ArrayList<CdmMetaData>();
52 result.add(new CdmMetaData(MetaDataPropertyName.DB_SCHEMA_VERSION, dbSchemaVersion));
53 return result;
54 }
55
56 public CdmMetaData(MetaDataPropertyName propertyName, String value) {
57 super();
58 this.propertyName = propertyName;
59 this.value = value;
60 }
61
62 /**
63 * @return the propertyName
64 */
65 public MetaDataPropertyName getPropertyName() {
66 return propertyName;
67 }
68
69 /**
70 * @param propertyName the propertyName to set
71 */
72 public void setPropertyName(MetaDataPropertyName propertyName) {
73 this.propertyName = propertyName;
74 }
75
76 /**
77 * @return the value
78 */
79 public String getValue() {
80 return value;
81 }
82
83 /**
84 * @param value the value to set
85 */
86 public void setValue(String value) {
87 this.value = value;
88 }
89
90
91 }