2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.cdm
.model
.common
;
13 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
14 import eu
.etaxonomy
.cdm
.model
.view
.View
;
15 import org
.apache
.log4j
.Logger
;
16 import eu
.etaxonomy
.cdm
.model
.Description
;
18 import javax
.persistence
.*;
23 * @created 08-Nov-2007 13:07:01
26 public abstract class VersionableEntity
extends CdmBase
{
27 public VersionableEntity() {
29 this.uuid
= UUID
.randomUUID().toString();
30 this.created
= Calendar
.getInstance();
33 static Logger logger
= Logger
.getLogger(VersionableEntity
.class);
35 //the globally unique identifier
37 private Calendar created
;
38 private Person createdBy
;
39 //time of last update for this object
40 private Calendar updated
;
41 private Person updatedBy
;
42 private VersionableEntity nextVersion
;
43 private VersionableEntity previousVersion
;
45 public VersionableEntity
getNextVersion(){
46 return this.nextVersion
;
51 * @param nextVersion nextVersion
53 public void setNextVersion(VersionableEntity nextVersion
){
54 this.nextVersion
= nextVersion
;
57 public VersionableEntity
getPreviousVersion(){
58 return this.previousVersion
;
63 * @param previousVersion previousVersion
65 public void setPreviousVersion(VersionableEntity previousVersion
){
66 this.previousVersion
= previousVersion
;
70 public Person
getUpdatedBy(){
71 return this.updatedBy
;
76 * @param updatedBy updatedBy
78 public void setUpdatedBy(Person updatedBy
){
79 this.updatedBy
= updatedBy
;
83 public Person
getCreatedBy(){
84 return this.createdBy
;
89 * @param createdBy createdBy
91 public void setCreatedBy(Person createdBy
){
92 this.createdBy
= createdBy
;
95 @Id @GeneratedValue(generator
="system-increment")
103 public void setId(int id
){
107 public String
getUuid(){
114 public void setUuid(String uuid
){
118 @Temporal(TemporalType
.TIMESTAMP
)
119 public Calendar
getCreated(){
124 * @param created created
126 public void setCreated(Calendar created
){
127 this.created
= created
;
130 @Temporal(TemporalType
.TIMESTAMP
)
131 public Calendar
getUpdated(){
137 * @param updated updated
139 public void setUpdated(Calendar updated
){
140 this.updated
= updated
;
147 public Calendar
getValidFrom(){
155 public Calendar
getValidTo(){