merge hibernate4 migration branch into trunk
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / common / VersionableEntity.java
index d3e42620c46f770989965298e353711879d34afc..2faa9aace6584f0728eeef73c4ec99eddf9520bd 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * 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.
 */
@@ -39,14 +39,14 @@ import eu.etaxonomy.cdm.strategy.match.MatchMode;
 
 /**
  * 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
  *
@@ -64,7 +64,7 @@ public abstract class VersionableEntity extends CdmBase implements IVersionableE
        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")
@@ -72,10 +72,10 @@ public abstract class VersionableEntity extends CdmBase implements IVersionableE
        @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")
@@ -83,40 +83,44 @@ public abstract class VersionableEntity extends CdmBase implements IVersionableE
        @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) {
@@ -144,10 +148,10 @@ public abstract class VersionableEntity extends CdmBase implements IVersionableE
                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.
@@ -158,10 +162,10 @@ public abstract class VersionableEntity extends CdmBase implements IVersionableE
        @Override
        public Object clone() throws CloneNotSupportedException{
                VersionableEntity result = (VersionableEntity)super.clone();
-               
+
                result.setUpdated(null);
                result.setUpdatedBy(null);
-               
+
                //no changes to: -
                return result;
        }