remove exception when comparing terms from 2 different vocabularies
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / term / OrderedTermBase.java
index 954ddae93bf306197ec8103f653dadaf6cb5f390..372065ed3e567e3bb1afe4ef00bc623e7c3035ef 100644 (file)
@@ -18,7 +18,8 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlSeeAlso;
 import javax.xml.bind.annotation.XmlType;
 
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.hibernate.envers.Audited;
 
 import eu.etaxonomy.cdm.common.CdmUtils;
@@ -74,7 +75,7 @@ public abstract class OrderedTermBase<T extends OrderedTermBase<T>>
 
 // *********************** CONSTRUCTOR *************************/
 
-    //for JAXB only, TODO needed?
+  //for hibernate use only, protected required by bytebuddy and subclasses outside package
     @Deprecated
     protected OrderedTermBase(){}
 
@@ -133,9 +134,6 @@ public abstract class OrderedTermBase<T extends OrderedTermBase<T>>
             if (this.vocabulary == null || thatTermLocal.vocabulary == null){
                 throw new IllegalStateException("An ordered term (" + this.toString() + " or " + thatTermLocal.toString() + ") of class " + this.getClass() + " or " + thatTermLocal.getClass() + " does not belong to a vocabulary and therefore can not be compared");
             }
-            if (! this.getVocabulary().getUuid().equals(thatTermLocal.vocabulary.getUuid())){
-               throw new IllegalStateException("2 terms do not belong to the same vocabulary and therefore can not be compared: " + this.getTitleCache() + " and " + thatTermLocal.getTitleCache());
-            }
         }
 
        int vocCompare = compareVocabularies(thatTermLocal);