Actions
task #8907
openreplace UuidAndTitleCacheTaxonComparator by type save implementation
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>
whereasSortableTaxonNodeQueryResult
is a sortable dto which will never leave the persistence layer.
Additinal task:
- clean up TaxonNodeDaoHibernateImplTest.findWithoutRank.xml from unused data
Related issues
Updated by Andreas Kohlbecker about 3 years ago
- Copied from bug #8892: Taxon search does not work for names without rank added
Updated by Andreas Kohlbecker about 3 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.
Updated by Katja Luther almost 3 years ago
- Related to bug #9053: CCE when selecting Character Tree for descriptive dataset added
Actions