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 #1

Updated by Andreas Kohlbecker about 4 years ago

  • Copied from bug #8892: Taxon search does not work for names without rank added
Actions #2

Updated by Andreas Kohlbecker about 4 years ago

  • Description updated (diff)
Actions #3

Updated by Andreas Kohlbecker about 4 years ago

  • Subject changed from replace UuidAndTitleCacheTaxonComparator by typesave implementation to replace UuidAndTitleCacheTaxonComparator by type save implementation
  • Status changed from New to Resolved
  • Assignee changed from Andreas Kohlbecker to Andreas Müller
  • % Done changed from 0 to 50

ticket completed.

Actions #4

Updated by Katja Luther almost 4 years ago

  • Related to bug #9053: CCE when selecting Character Tree for descriptive dataset added
Actions

Also available in: Atom PDF