Merged search changes from 2.0
authora.babadshanjan <a.babadshanjan@localhost>
Thu, 28 May 2009 12:37:05 +0000 (12:37 +0000)
committera.babadshanjan <a.babadshanjan@localhost>
Thu, 28 May 2009 12:37:05 +0000 (12:37 +0000)
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/IdentifiableEntity.java

index 06ffec5f4957e6d1a4712833ae1bcf18e81478eb..ea4405763ac9428359b6f121a004fafcf599c503 100644 (file)
@@ -346,12 +346,21 @@ implements ISourceable, IIdentifiableEntity, Comparable<IdentifiableEntity> {
                 if(identifiableEntity instanceof NonViralName) {
                         specifiedNameCache = HibernateProxyHelper.deproxy(identifiableEntity, NonViralName.class).getNameCache();
                         specifiedTitleCache = identifiableEntity.getTitleCache();
+                        
                 } else if(identifiableEntity instanceof TaxonBase) {
                         TaxonBase taxonBase = HibernateProxyHelper.deproxy(identifiableEntity, TaxonBase.class);
-                        TaxonNameBase<?,?> taxonNameBase= taxonBase.getName();
+                        
+                        TaxonNameBase<?,?> taxonNameBase = taxonBase.getName();
                         specifiedNameCache = HibernateProxyHelper.deproxy(taxonNameBase, NonViralName.class).getNameCache();
                         specifiedTitleCache = taxonNameBase.getTitleCache();
-                        specifiedReferenceTitleCache = ((TaxonBase)identifiableEntity).getSec().getTitleCache();
+                        
+                        //specifiedReferenceTitleCache = ((TaxonBase)identifiableEntity).getSec().getTitleCache();
+//                      ReferenceBase referenceBase = taxonBase.getSec();
+//                      if (referenceBase != null) {
+//           FIXME: HibernateProxyHelper.deproxy(referenceBase, ReferenceBase.class) throws exception
+//                              referenceBase = HibernateProxyHelper.deproxy(referenceBase, ReferenceBase.class);
+//                              specifiedReferenceTitleCache = referenceBase.getTitleCache();
+//                      }
                 }
                 
                 if(this instanceof NonViralName) {