/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
/**
* The class keeps track of versions via a full linked list to different version objects, or a simple updated/updatedBy property in the same object.
- *
+ *
* Full versioning allows concrete subclasses to keep track of previous or later versions of an object.
- * A different version is another (persistent) java object, but with the same UUID.
+ * A different version is another (persistent) java object, but with the same UUID.
* The version history is established as a linked list of the version objects in time.
* If versioning via the linked list is used, updated/updatedBy is the same as created/createdBy (better NULL?).
- *
+ *
* Versioning can be turned off and in this case this class provides updated/updatedBy to keep track of the latest change event.
- *
+ *
* @author m.doering
* @created 08-Nov-2007 13:07:01
*
private static final long serialVersionUID = 1409299200302758513L;
@SuppressWarnings("unused")
private static final Logger logger = Logger.getLogger(VersionableEntity.class);
-
+
@XmlElement(name ="Updated", type = String.class)
@XmlJavaTypeAdapter(DateTimeAdapter.class)
//@XmlElement(name ="Updated")
@Type(type="dateTimeUserType")
@Basic(fetch = FetchType.LAZY)
@Match(MatchMode.IGNORE)
- @Field(index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.NO) //TODO H42 was UN_TOKENIZED
+ @Field(analyze = Analyze.NO)
@FieldBridge(impl = DateTimeBridge.class)
private DateTime updated;
-
+
@XmlElement(name = "UpdatedBy")
@XmlIDREF
@XmlSchemaType(name = "IDREF")
@Match(MatchMode.IGNORE)
private User updatedBy;
- public User getUpdatedBy(){
+ @Override
+ public User getUpdatedBy(){
return this.updatedBy;
}
/**
- *
+ *
* @param updatedBy updatedBy
*/
- public void setUpdatedBy(User updatedBy){
+ @Override
+ public void setUpdatedBy(User updatedBy){
this.updatedBy = updatedBy;
}
/**
- *
+ *
* @return
*/
- public DateTime getUpdated(){
+ @Override
+ public DateTime getUpdated(){
return this.updated;
}
/**
- *
+ *
* @param updated updated
*/
- public void setUpdated(DateTime updated){
+ @Override
+ public void setUpdated(DateTime updated){
this.updated = updated;
}
-
+
/**
* Is true if UUID and created timestamp are the same for the passed Object and this one.
* @see eu.etaxonomy.cdm.model.common.CdmBase#equals(java.lang.Object)
- * See {@link http://www.hibernate.org/109.html hibernate109}, {@link http://www.geocities.com/technofundo/tech/java/equalhash.html geocities}
+ * See {@link http://www.hibernate.org/109.html hibernate109}, {@link http://www.geocities.com/technofundo/tech/java/equalhash.html geocities}
* or {@link http://www.ibm.com/developerworks/java/library/j-jtp05273.html ibm}
- * for more information about equals and hashcode.
+ * for more information about equals and hashcode.
*/
@Override
public boolean equals(Object obj) {
return true;
}
-
+
//********************** CLONE *****************************************/
-
- /**
+
+ /**
* Clones this versionable entity.
* Set fields for nextVersion, previousVersion, updated, updatedBy and createdBy are set to <tt>null</tt>
* The id is set to 0.
@Override
public Object clone() throws CloneNotSupportedException{
VersionableEntity result = (VersionableEntity)super.clone();
-
+
result.setUpdated(null);
result.setUpdatedBy(null);
-
+
//no changes to: -
return result;
}