Project

General

Profile

Revision 0ef48948

ID0ef489482c39c63fc48ed48229d694d59e609a44
Parent 35b3906e
Child d6cce84d

Added by Patrick Plitzner about 1 year ago

ref #8450 Add recordBasis and isIndividualsAssociation to wrapper

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/occurrence/OccurrenceDaoHibernateImpl.java
536 536
        return results;
537 537
    }
538 538

  
539
    private List<SpecimenNodeWrapper> querySpecimen(
540
            Query query, List<UUID> taxonNodeUuids,
539
    private List<SpecimenNodeWrapper> querySpecimen(Query query, List<UUID> taxonNodeUuids,
541 540
            Integer limit, Integer start){
541
        return querySpecimen(query, taxonNodeUuids, false, limit, start);
542
    }
543

  
544
    private List<SpecimenNodeWrapper> querySpecimen(Query query, List<UUID> taxonNodeUuids,
545
            boolean isIndividualsAssociation, Integer limit, Integer start){
542 546
        query.setParameterList("taxonNodeUuids", taxonNodeUuids);
543 547

  
544 548
        addLimitAndStart(query, limit, start);
......
552 556
                            (UUID) object[0],
553 557
                            (Integer) object[1],
554 558
                            (String) object[2]),
555
                    (TaxonNode)object[3]));
559
                    (SpecimenOrObservationType)object[3],
560
                    isIndividualsAssociation,
561
                    (TaxonNode)object[4]));
556 562
        }
557 563
        return list;
558 564
    }
......
563 569
                + "de.associatedSpecimenOrObservation.uuid, "
564 570
                + "de.associatedSpecimenOrObservation.id, "
565 571
                + "de.associatedSpecimenOrObservation.titleCache, "
572
                + "de.associatedSpecimenOrObservation.recordBasis, "
566 573
                + "tn "
567 574
                + "FROM DescriptionElementBase AS de "
568 575
                + "LEFT JOIN de.inDescription AS d "
......
572 579
                + "AND tn.uuid in (:taxonNodeUuids) "
573 580
                ;
574 581
        Query query = getSession().createQuery(queryString);
575
        return querySpecimen(query, taxonNodeUuids, limit, start);
582
        return querySpecimen(query, taxonNodeUuids, true, limit, start);
576 583
    }
577 584

  
578 585
    private List<SpecimenNodeWrapper> queryTypeSpecimen(List<UUID> taxonNodeUuids,
......
581 588
                + "td.typeSpecimen.uuid, "
582 589
                + "td.typeSpecimen.id, "
583 590
                + "td.typeSpecimen.titleCache, "
591
                + "td.typeSpecimen.recordBasis, "
584 592
                + "tn "
585 593
                + "FROM SpecimenTypeDesignation AS td "
586 594
                + "LEFT JOIN td.typifiedNames AS tn "
......
598 606
                + "det.identifiedUnit.uuid, "
599 607
                + "det.identifiedUnit.id, "
600 608
                + "det.identifiedUnit.titleCache, "
609
                + "det.identifiedUnit.recordBasis, "
601 610
                + "tn "
602 611
                + "FROM DeterminationEvent AS det "
603 612
                + "LEFT JOIN det.taxon AS t "
......
614 623
                + "det.identifiedUnit.uuid, "
615 624
                + "det.identifiedUnit.id, "
616 625
                + "det.identifiedUnit.titleCache, "
626
                + "det.identifiedUnit.recordBasis, "
617 627
                + "tn "
618 628
                + "FROM DeterminationEvent AS det "
619 629
                + "LEFT JOIN det.taxonName AS n "
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dto/SpecimenNodeWrapper.java
11 11
import java.io.Serializable;
12 12

  
13 13
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
14
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
14 15
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
15 16

  
16 17
/**
......
23 24
    private static final long serialVersionUID = -7137923139085928830L;
24 25

  
25 26
    private UuidAndTitleCache<SpecimenOrObservationBase> uuidAndTitleCache;
27
    private SpecimenOrObservationType type;
28
    private boolean isIndividualsAssociation;
26 29
    private TaxonNode taxonNode;
27
    public SpecimenNodeWrapper(UuidAndTitleCache<SpecimenOrObservationBase> uuidAndTitleCache, TaxonNode taxonNode) {
30

  
31
    public SpecimenNodeWrapper(UuidAndTitleCache<SpecimenOrObservationBase> uuidAndTitleCache,
32
            SpecimenOrObservationType type,
33
            boolean isIndividualsAssociation,
34
            TaxonNode taxonNode) {
28 35
        super();
29 36
        this.uuidAndTitleCache = uuidAndTitleCache;
37
        this.type = type;
38
        this.isIndividualsAssociation = isIndividualsAssociation;
30 39
        this.taxonNode = taxonNode;
31 40
    }
32 41
    public UuidAndTitleCache<SpecimenOrObservationBase> getUuidAndTitleCache() {
33 42
        return uuidAndTitleCache;
34 43
    }
44
    public SpecimenOrObservationType getType() {
45
        return type;
46
    }
47
    public boolean isIndividualsAssociation() {
48
        return isIndividualsAssociation;
49
    }
35 50
    public TaxonNode getTaxonNode() {
36 51
        return taxonNode;
37 52
    }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)