Project

General

Profile

Actions

task #8907

open

replace UuidAndTitleCacheTaxonComparator by type save implementation

Added by Andreas Kohlbecker about 4 years ago. Updated about 4 years ago.

Status:
Resolved
Priority:
Highest
Category:
cdmlib
Target version:
Start date:
Due date:
% Done:

50%

Estimated time:
Severity:
normal

Description

copied from #8892:

UuidAndTitleCacheTaxonComparator is used by different methods which pass Object array with different content:

  • TaxonNodeDaoHibernateImpl.getTaxonNodeDto(Integer limit, String pattern, UUID classificationUuid) ==> tn.uuid, tn.id, t.titleCache, t.name, rank
  • TaxonNodeDaoHibernateImpl.getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(..) ==> nodes.uuid, nodes.id, taxon.titleCache, taxon.name, rank
  • TaxonNodeDaoHibernateImpl.getUuidAndTitleCache(Integer limit, String pattern, UUID classificationUuid) ==> 'tn.uuid, tn.id, t.titleCache, name, name_rank'
  • TaxonDaoHibernateImpl.getUuidAndTitleCache ==> tb.uuid, tb.id, tb.titleCache, tb.name.rank BUG: rank is passed instead of name here!
  • IdentifiableDaoBase.getUuidAndTitleCache ==> uuid, id, titleCache SCARY: It seems as if this comparator has initially been used to compare arbitrary IndentifieableEntities. for my feeling this comparator is too much overloaded

Since UuidAndTitleCacheTaxonComparator is used a lot by methods it is quite unsave that it takes object arrays as parameters. We need a comparator for more specific dto class instead.

Suggested solution:

  • create specific comparator SortableTaxonNodeQueryResultComparator implements Comparator<SortableTaxonNodeQueryResult> whereas SortableTaxonNodeQueryResult is a sortable dto which will never leave the persistence layer.

Additinal task:

  • clean up TaxonNodeDaoHibernateImplTest.findWithoutRank.xml from unused data

Related issues

Related to EDIT - bug #9053: CCE when selecting Character Tree for descriptive datasetClosedKatja Luther

Actions
Copied from EDIT - bug #8892: Taxon search does not work for names without rankClosedAndreas Kohlbecker

Actions
Actions

Also available in: Atom PDF