Project

General

Profile

Revision 88d0b58a

ID88d0b58a72b4482c3231d204729be46f6c0c988d
Parent 7c452fe9
Child a6adf906

Added by Patrick Plitzner about 4 years ago

Pass pageSize and pageNumber to list method

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/OccurrenceServiceImpl.java
365 365
        }
366 366

  
367 367
        // gather the IDs of all relevant field units
368
        Set<Integer> fieldUnitIds = new HashSet<Integer>();
368
        Set<UUID> fieldUnitUuids = new HashSet<UUID>();
369 369
        List<SpecimenOrObservationBase> records = listByAssociatedTaxon(null, includeRelationships, associatedTaxon, maxDepth, null, null, orderHints, propertyPaths);
370 370
        for (SpecimenOrObservationBase<?> specimen : records) {
371 371
            for (FieldUnit fieldUnit : getFieldUnits(specimen.getUuid())) {
372
                fieldUnitIds.add(fieldUnit.getId());
372
                fieldUnitUuids.add(fieldUnit.getUuid());
373 373
            }
374 374
        }
375
        //dao.listByIds() does the paging of the field units. Passing the field units directly to the Pager would not work
376
        List<SpecimenOrObservationBase> fieldUnits = dao.loadList(fieldUnitIds, propertyPaths);
377
        return new DefaultPagerImpl<SpecimenOrObservationBase>(pageNumber, fieldUnitIds.size(), pageSize, fieldUnits);
375
        //dao.list() does the paging of the field units. Passing the field units directly to the Pager would not work
376
        List<SpecimenOrObservationBase> fieldUnits = dao.list(fieldUnitUuids, pageSize, pageNumber, orderHints, propertyPaths);
377
        return new DefaultPagerImpl<SpecimenOrObservationBase>(pageNumber, fieldUnitUuids.size(), pageSize, fieldUnits);
378 378
    }
379 379

  
380 380
    @Override

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)