Project

General

Profile

« Previous | Next » 

Revision b2128023

Added by Patrick Plitzner about 6 years ago

ref #7095 Extract row comparator to own class file

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/workingSet/matrix/RowWrapper.java
17 17
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
18 18
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
19 19
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
20
import eu.etaxonomy.cdm.model.taxon.Taxon;
20 21
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
21 22
import eu.etaxonomy.taxeditor.model.MessagingUtils;
22 23
import eu.etaxonomy.taxeditor.store.CdmStore;
......
30 31

  
31 32
    private SpecimenDescription description;
32 33

  
33
    private Collection<TaxonBase<?>> associatedTaxa;
34
    private Taxon associatedTaxon;
34 35
    private FieldUnit fieldUnit;
35 36
    private String identifier;
36 37
    private NamedArea country;
......
41 42
        IOccurrenceService occurrenceService = CdmStore.getService(IOccurrenceService.class);
42 43
        SpecimenOrObservationBase<?> specimen = HibernateProxyHelper.deproxy(description.getDescribedSpecimenOrObservation(), SpecimenOrObservationBase.class);
43 44
        if(specimen!=null){
44
            associatedTaxa = occurrenceService.listAssociatedTaxa(specimen, null, null, null, null);
45
            Collection<TaxonBase<?>> associatedTaxa = occurrenceService.listAssociatedTaxa(specimen, null, null, null, null);
46
            if(associatedTaxa!=null){
47
                associatedTaxon = (Taxon) associatedTaxa.iterator().next();
48
            }
45 49
            Collection<FieldUnit> fieldUnits = occurrenceService.getFieldUnits(specimen.getUuid());
46 50
            if(fieldUnits.size()!=1){
47 51
                MessagingUtils.error(RowWrapper.class, "More than one or no field unit found for specimen", null);
......
62 66
        return description;
63 67
    }
64 68

  
65
    public Collection<TaxonBase<?>> getAssociatedTaxa() {
66
        return associatedTaxa;
69
    public Taxon getAssociatedTaxon() {
70
        return associatedTaxon;
67 71
    }
68 72

  
69 73
    public FieldUnit getFieldUnit() {

Also available in: Unified diff