Revision 79c29018
Added by Patrick Plitzner almost 5 years ago
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/name/TaxonNameDaoHibernateImpl.java | ||
---|---|---|
40 | 40 |
import eu.etaxonomy.cdm.model.name.NameRelationship; |
41 | 41 |
import eu.etaxonomy.cdm.model.name.NameRelationshipType; |
42 | 42 |
import eu.etaxonomy.cdm.model.name.Rank; |
43 |
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation; |
|
43 | 44 |
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus; |
44 | 45 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
45 | 46 |
import eu.etaxonomy.cdm.model.name.TypeDesignationBase; |
... | ... | |
359 | 360 |
return getTypeDesignations(name, null, status, pageSize, pageNumber, propertyPaths); |
360 | 361 |
} |
361 | 362 |
|
363 |
@Override |
|
364 |
public List<Integer> getTypeSpecimenIdsForTaxonName(TaxonName name, |
|
365 |
TypeDesignationStatusBase status, Integer pageSize, Integer pageNumber){ |
|
366 |
Query query = getTypeDesignationQuery("designation.typeSpecimen.id", name, SpecimenTypeDesignation.class, status); |
|
367 |
|
|
368 |
if(pageSize != null) { |
|
369 |
query.setMaxResults(pageSize); |
|
370 |
if(pageNumber != null) { |
|
371 |
query.setFirstResult(pageNumber * pageSize); |
|
372 |
} else { |
|
373 |
query.setFirstResult(0); |
|
374 |
} |
|
375 |
} |
|
376 |
return query.list(); |
|
377 |
} |
|
378 |
|
|
362 | 379 |
@Override |
363 | 380 |
public <T extends TypeDesignationBase> List<T> getTypeDesignations(TaxonName name, |
364 | 381 |
Class<T> type, |
365 | 382 |
TypeDesignationStatusBase status, Integer pageSize, Integer pageNumber, |
366 | 383 |
List<String> propertyPaths){ |
367 | 384 |
checkNotInPriorView("getTypeDesignations(TaxonName name,TypeDesignationStatusBase status, Integer pageSize, Integer pageNumber, List<String> propertyPaths)"); |
385 |
|
|
386 |
Query query = getTypeDesignationQuery("designation", name, type, status); |
|
387 |
|
|
388 |
if(pageSize != null) { |
|
389 |
query.setMaxResults(pageSize); |
|
390 |
if(pageNumber != null) { |
|
391 |
query.setFirstResult(pageNumber * pageSize); |
|
392 |
} else { |
|
393 |
query.setFirstResult(0); |
|
394 |
} |
|
395 |
} |
|
396 |
return defaultBeanInitializer.initializeAll((List<T>)query.list(), propertyPaths); |
|
397 |
} |
|
398 |
|
|
399 |
private <T extends TypeDesignationBase> Query getTypeDesignationQuery(String select, TaxonName name, |
|
400 |
Class<T> type, TypeDesignationStatusBase status){ |
|
368 | 401 |
Query query = null; |
369 |
String queryString = "select designation from TypeDesignationBase designation join designation.typifiedNames name where name = :name";
|
|
402 |
String queryString = "select "+select+" from TypeDesignationBase designation join designation.typifiedNames name where name = :name";
|
|
370 | 403 |
|
371 | 404 |
if(status != null) { |
372 | 405 |
queryString += " and designation.typeStatus = :status"; |
... | ... | |
385 | 418 |
} |
386 | 419 |
|
387 | 420 |
query.setParameter("name",name); |
388 |
|
|
389 |
if(pageSize != null) { |
|
390 |
query.setMaxResults(pageSize); |
|
391 |
if(pageNumber != null) { |
|
392 |
query.setFirstResult(pageNumber * pageSize); |
|
393 |
} else { |
|
394 |
query.setFirstResult(0); |
|
395 |
} |
|
396 |
} |
|
397 |
return defaultBeanInitializer.initializeAll((List<T>)query.list(), propertyPaths); |
|
421 |
return query; |
|
398 | 422 |
} |
399 | 423 |
|
400 |
|
|
401 | 424 |
public List<TaxonName> searchNames(String queryString, MatchMode matchMode, Integer pageSize, Integer pageNumber) { |
402 | 425 |
checkNotInPriorView("TaxonNameDaoHibernateImpl.searchNames(String queryString, Integer pageSize, Integer pageNumber)"); |
403 | 426 |
Criteria criteria = getSession().createCriteria(TaxonName.class); |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/occurrence/OccurrenceDaoHibernateImpl.java | ||
---|---|---|
20 | 20 |
import org.hibernate.Query; |
21 | 21 |
import org.hibernate.Session; |
22 | 22 |
import org.hibernate.criterion.Disjunction; |
23 |
import org.hibernate.criterion.ProjectionList; |
|
23 | 24 |
import org.hibernate.criterion.Projections; |
24 | 25 |
import org.hibernate.criterion.Restrictions; |
25 | 26 |
import org.hibernate.envers.query.AuditEntity; |
... | ... | |
31 | 32 |
|
32 | 33 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
33 | 34 |
import eu.etaxonomy.cdm.model.description.DescriptionBase; |
34 |
import eu.etaxonomy.cdm.model.description.DescriptionElementBase; |
|
35 | 35 |
import eu.etaxonomy.cdm.model.description.IndividualsAssociation; |
36 | 36 |
import eu.etaxonomy.cdm.model.media.Media; |
37 | 37 |
import eu.etaxonomy.cdm.model.molecular.DnaSample; |
... | ... | |
341 | 341 |
} |
342 | 342 |
|
343 | 343 |
@Override |
344 |
public <T extends SpecimenOrObservationBase> List<T> findOccurrences(Class<T> clazz, String queryString, |
|
345 |
String significantIdentifier, SpecimenOrObservationType recordBasis, Taxon associatedTaxon, TaxonName associatedTaxonName, |
|
346 |
MatchMode matchmode, Integer limit, |
|
347 |
Integer start, List<OrderHint> orderHints, List<String> propertyPaths) { |
|
348 |
|
|
344 |
public <T extends SpecimenOrObservationBase> List<UuidAndTitleCache<SpecimenOrObservationBase>> findOccurrencesUuidAndTitleCache( |
|
345 |
Class<T> clazz, String queryString, String significantIdentifier, SpecimenOrObservationType recordBasis, |
|
346 |
Taxon associatedTaxon, TaxonName associatedTaxonName, MatchMode matchmode, Integer limit, Integer start, |
|
347 |
List<OrderHint> orderHints) { |
|
349 | 348 |
Criteria criteria = createFindOccurrenceCriteria(clazz, queryString, significantIdentifier, recordBasis, |
350 |
associatedTaxon, associatedTaxonName, matchmode, limit, start, orderHints, propertyPaths); |
|
351 |
|
|
349 |
associatedTaxon, associatedTaxonName, matchmode, limit, start, orderHints, null); |
|
352 | 350 |
if(criteria!=null){ |
351 |
ProjectionList projectionList = Projections.projectionList(); |
|
352 |
projectionList.add(Projections.property("uuid")); |
|
353 |
projectionList.add(Projections.property("id")); |
|
354 |
projectionList.add(Projections.property("titleCache")); |
|
355 |
criteria.setProjection(projectionList); |
|
353 | 356 |
|
354 |
if(limit != null) { |
|
355 |
if(start != null) { |
|
356 |
criteria.setFirstResult(start); |
|
357 |
} else { |
|
358 |
criteria.setFirstResult(0); |
|
359 |
} |
|
360 |
criteria.setMaxResults(limit); |
|
357 |
List<Object[]> result = criteria.list(); |
|
358 |
List<UuidAndTitleCache<SpecimenOrObservationBase>> uuidAndTitleCacheList = new ArrayList<>(); |
|
359 |
for(Object[] object : result){ |
|
360 |
uuidAndTitleCacheList.add(new UuidAndTitleCache<SpecimenOrObservationBase>((UUID) object[0],(Integer) object[1], (String) object[2])); |
|
361 | 361 |
} |
362 |
return uuidAndTitleCacheList; |
|
363 |
} |
|
364 |
return Collections.emptyList(); |
|
365 |
} |
|
362 | 366 |
|
363 |
if(orderHints!=null){ |
|
364 |
addOrder(criteria,orderHints); |
|
365 |
} |
|
367 |
@Override |
|
368 |
public <T extends SpecimenOrObservationBase> List<T> findOccurrences(Class<T> clazz, String queryString, |
|
369 |
String significantIdentifier, SpecimenOrObservationType recordBasis, Taxon associatedTaxon, TaxonName associatedTaxonName, |
|
370 |
MatchMode matchmode, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) { |
|
366 | 371 |
|
372 |
Criteria criteria = createFindOccurrenceCriteria(clazz, queryString, significantIdentifier, recordBasis, |
|
373 |
associatedTaxon, associatedTaxonName, matchmode, limit, start, orderHints, propertyPaths); |
|
374 |
if(criteria!=null){ |
|
367 | 375 |
@SuppressWarnings("unchecked") |
368 | 376 |
List<T> results = criteria.list(); |
369 | 377 |
defaultBeanInitializer.initializeAll(results, propertyPaths); |
... | ... | |
423 | 431 |
Set<UUID> associationUuids = new HashSet<UUID>(); |
424 | 432 |
//taxon associations |
425 | 433 |
if(associatedTaxon!=null){ |
426 |
List<? extends SpecimenOrObservationBase> associatedTaxaList = listByAssociatedTaxon(clazz, associatedTaxon, limit, start, orderHints, propertyPaths);
|
|
434 |
List<UuidAndTitleCache<SpecimenOrObservationBase>> associatedTaxaList = listUuidAndTitleCacheByAssociatedTaxon(clazz, associatedTaxon, limit, start, orderHints);
|
|
427 | 435 |
if(associatedTaxaList!=null){ |
428 |
for (SpecimenOrObservationBase specimenOrObservationBase : associatedTaxaList) {
|
|
429 |
associationUuids.add(specimenOrObservationBase.getUuid());
|
|
436 |
for (UuidAndTitleCache<SpecimenOrObservationBase> uuidAndTitleCache : associatedTaxaList) {
|
|
437 |
associationUuids.add(uuidAndTitleCache.getUuid());
|
|
430 | 438 |
} |
431 | 439 |
} |
432 | 440 |
} |
... | ... | |
447 | 455 |
return null; |
448 | 456 |
} |
449 | 457 |
} |
458 |
if(limit != null) { |
|
459 |
if(start != null) { |
|
460 |
criteria.setFirstResult(start); |
|
461 |
} else { |
|
462 |
criteria.setFirstResult(0); |
|
463 |
} |
|
464 |
criteria.setMaxResults(limit); |
|
465 |
} |
|
450 | 466 |
|
467 |
if(orderHints!=null){ |
|
468 |
addOrder(criteria,orderHints); |
|
469 |
} |
|
451 | 470 |
return criteria; |
452 | 471 |
} |
453 | 472 |
|
... | ... | |
570 | 589 |
return results; |
571 | 590 |
} |
572 | 591 |
|
592 |
|
|
593 |
@Override |
|
594 |
public <T extends SpecimenOrObservationBase> List<UuidAndTitleCache<SpecimenOrObservationBase>> listUuidAndTitleCacheByAssociatedTaxon(Class<T> clazz, Taxon associatedTaxon, |
|
595 |
Integer limit, Integer start, List<OrderHint> orderHints){ |
|
596 |
Query query = createSpecimenQuery("sob.uuid, sob.id, sob.titleCache", clazz, associatedTaxon, limit, start, orderHints, null); |
|
597 |
if(query==null){ |
|
598 |
return Collections.emptyList(); |
|
599 |
} |
|
600 |
List<UuidAndTitleCache<SpecimenOrObservationBase>> list = new ArrayList<>(); |
|
601 |
List<Object[]> result = query.list(); |
|
602 |
for(Object[] object : result){ |
|
603 |
list.add(new UuidAndTitleCache<SpecimenOrObservationBase>((UUID) object[0],(Integer) object[1], (String) object[2])); |
|
604 |
} |
|
605 |
return list; |
|
606 |
} |
|
607 |
|
|
573 | 608 |
@Override |
574 | 609 |
public <T extends SpecimenOrObservationBase> List<T> listByAssociatedTaxon(Class<T> clazz, |
575 | 610 |
Taxon associatedTaxon, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) { |
611 |
Query query = createSpecimenQuery("sob", clazz, associatedTaxon, limit, start, orderHints, propertyPaths); |
|
612 |
if(query==null){ |
|
613 |
return Collections.emptyList(); |
|
614 |
} |
|
615 |
List<T> results = query.list(); |
|
616 |
defaultBeanInitializer.initializeAll(results, propertyPaths); |
|
617 |
return results; |
|
618 |
} |
|
576 | 619 |
|
577 |
Set<SpecimenOrObservationBase> setOfAll = new HashSet<SpecimenOrObservationBase>(); |
|
620 |
private <T extends SpecimenOrObservationBase> Query createSpecimenQuery(String select, Class<T> clazz, |
|
621 |
Taxon associatedTaxon, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths){ |
|
622 |
Set<SpecimenOrObservationBase> setOfAll = new HashSet<>(); |
|
623 |
Set<Integer> setOfAllIds = new HashSet<>(); |
|
578 | 624 |
|
579 | 625 |
Criteria criteria = null; |
580 | 626 |
if(clazz == null) { |
... | ... | |
610 | 656 |
} |
611 | 657 |
criteria.setMaxResults(limit); |
612 | 658 |
} |
659 |
criteria.setProjection(Projections.property("id")); |
|
613 | 660 |
|
614 | 661 |
addOrder(criteria,orderHints); |
615 | 662 |
|
616 | 663 |
@SuppressWarnings("unchecked") |
617 |
List<SpecimenOrObservationBase> detResults = criteria.list(); |
|
618 |
defaultBeanInitializer.initializeAll(detResults, propertyPaths); |
|
619 |
setOfAll.addAll(detResults); |
|
664 |
List<Integer> detResults = criteria.list(); |
|
665 |
setOfAllIds.addAll(detResults); |
|
620 | 666 |
|
621 | 667 |
// The IndividualsAssociation elements in a TaxonDescription contain DerivedUnits |
622 |
Criteria descriptionElementCriteria = getSession().createCriteria(DescriptionElementBase.class); |
|
623 |
Criteria inDescriptionCriteria = descriptionElementCriteria.createCriteria("inDescription").add(Restrictions.eqOrIsNull("class", "TaxonDescription")); |
|
624 |
Criteria taxonCriteria = inDescriptionCriteria.createCriteria("taxon"); |
|
625 |
taxonCriteria.add(Restrictions.eq("uuid", associatedTaxon.getUuid())); |
|
626 |
descriptionElementCriteria.setProjection(Projections.property("associatedSpecimenOrObservation")); |
|
627 |
|
|
628 |
|
|
629 |
setOfAll.addAll(descriptionElementCriteria.list()); |
|
668 |
setOfAllIds.addAll(descriptionDao.getIndividualAssociationSpecimenIDs( |
|
669 |
associatedTaxon.getUuid(), null, null, 0, null)); |
|
630 | 670 |
|
631 | 671 |
|
632 | 672 |
// SpecimenTypeDesignations may be associated with the TaxonName. |
633 |
List<SpecimenTypeDesignation> bySpecimenTypeDesignation = taxonNameDao.getTypeDesignations(associatedTaxon.getName(), |
|
634 |
SpecimenTypeDesignation.class, null, null, 0, null); |
|
635 |
for (SpecimenTypeDesignation specimenTypeDesignation : bySpecimenTypeDesignation) { |
|
636 |
setOfAll.add(specimenTypeDesignation.getTypeSpecimen()); |
|
637 |
} |
|
673 |
setOfAllIds.addAll(taxonNameDao.getTypeSpecimenIdsForTaxonName( |
|
674 |
associatedTaxon.getName(), null, null, null)); |
|
638 | 675 |
|
639 | 676 |
// SpecimenTypeDesignations may be associated with any HomotypicalGroup related to the specific Taxon. |
677 |
//TODO adapt to set of ids |
|
640 | 678 |
for(HomotypicalGroup homotypicalGroup : associatedTaxon.getHomotypicSynonymyGroups()) { |
641 | 679 |
List<SpecimenTypeDesignation> byHomotypicalGroup = homotypicalGroupDao.getTypeDesignations(homotypicalGroup, SpecimenTypeDesignation.class, null, null, 0, null); |
642 | 680 |
for (SpecimenTypeDesignation specimenTypeDesignation : byHomotypicalGroup) { |
... | ... | |
644 | 682 |
} |
645 | 683 |
} |
646 | 684 |
|
647 |
if(setOfAll.size() == 0){ |
|
685 |
if(setOfAllIds.size() == 0){
|
|
648 | 686 |
// no need querying the data base |
649 |
return new ArrayList<T>();
|
|
687 |
return null;
|
|
650 | 688 |
} |
651 | 689 |
|
652 | 690 |
String queryString = |
653 |
"select sob " +
|
|
691 |
"select "+select+
|
|
654 | 692 |
" from SpecimenOrObservationBase sob" + |
655 |
" where sob in (:setOfAll)";
|
|
693 |
" where sob.id in (:setOfAllIds)";
|
|
656 | 694 |
|
657 | 695 |
if(clazz != null && !clazz.equals(SpecimenOrObservationBase.class)){ |
658 | 696 |
queryString += " and sob.class = :type "; |
... | ... | |
671 | 709 |
} |
672 | 710 |
|
673 | 711 |
Query query = getSession().createQuery(queryString); |
674 |
query.setParameterList("setOfAll", setOfAll);
|
|
712 |
query.setParameterList("setOfAllIds", setOfAllIds);
|
|
675 | 713 |
|
676 | 714 |
if(clazz != null && !clazz.equals(SpecimenOrObservationBase.class)){ |
677 | 715 |
query.setParameter("type", clazz.getSimpleName()); |
... | ... | |
686 | 724 |
query.setMaxResults(limit); |
687 | 725 |
} |
688 | 726 |
|
689 |
|
|
690 |
List<T> results = query.list(); |
|
691 |
defaultBeanInitializer.initializeAll(results, propertyPaths); |
|
692 |
return results; |
|
727 |
return query; |
|
693 | 728 |
} |
694 | 729 |
|
695 | 730 |
@Override |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/name/ITaxonNameDao.java | ||
---|---|---|
146 | 146 |
TypeDesignationStatusBase status, Integer pageSize, Integer pageNumber, |
147 | 147 |
List<String> propertyPaths); |
148 | 148 |
|
149 |
/** |
|
150 |
* Return a list ids of specimens that are type specimens for the given name |
|
151 |
* @param name |
|
152 |
* @param status |
|
153 |
* @param pageSize |
|
154 |
* @param pageNumber |
|
155 |
* @return |
|
156 |
*/ |
|
157 |
public List<Integer> getTypeSpecimenIdsForTaxonName(TaxonName name, |
|
158 |
TypeDesignationStatusBase status, Integer pageSize, Integer pageNumber); |
|
159 |
|
|
149 | 160 |
/** |
150 | 161 |
* Return a List of types related to this name, optionally filtered by type |
151 | 162 |
* designation status |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/occurrence/IOccurrenceDao.java | ||
---|---|---|
133 | 133 |
TaxonName associatedTaxonName, MatchMode matchmode, Integer limit, Integer start, |
134 | 134 |
List<OrderHint> orderHints, List<String> propertyPaths); |
135 | 135 |
|
136 |
/** |
|
137 |
* @see IOccurrenceDao#findOccurrences(Class, String, String, SpecimenOrObservationType, Taxon, TaxonName, MatchMode, Integer, Integer, List, List) |
|
138 |
* @param clazz |
|
139 |
* @param queryString |
|
140 |
* @param significantIdentifier |
|
141 |
* @param type |
|
142 |
* @param determinedAs |
|
143 |
* @param associatedTaxonName |
|
144 |
* @param matchmode |
|
145 |
* @param limit |
|
146 |
* @param start |
|
147 |
* @param orderHints |
|
148 |
* @param propertyPaths |
|
149 |
* @return |
|
150 |
*/ |
|
151 |
public <T extends SpecimenOrObservationBase> List<UuidAndTitleCache<SpecimenOrObservationBase>> findOccurrencesUuidAndTitleCache( |
|
152 |
Class<T> clazz, String queryString, |
|
153 |
String significantIdentifier, SpecimenOrObservationType type, Taxon determinedAs, |
|
154 |
TaxonName associatedTaxonName, MatchMode matchmode, Integer limit, Integer start, |
|
155 |
List<OrderHint> orderHints); |
|
156 |
|
|
136 | 157 |
/** |
137 | 158 |
* Returns the number of specimens that match the given parameters |
138 | 159 |
* <b>Note:</b> Specifying a taxon will already check the name of this |
... | ... | |
278 | 299 |
public <T extends SpecimenOrObservationBase> List<T> listByAssociatedTaxon(Class<T> type, Taxon associatedTaxon, |
279 | 300 |
Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths); |
280 | 301 |
|
302 |
/** |
|
303 |
* @see IOccurrenceDao#listByAssociatedTaxon(Class, Taxon, Integer, Integer, List, List) |
|
304 |
* @param type |
|
305 |
* @param associatedTaxon |
|
306 |
* @param limit |
|
307 |
* @param start |
|
308 |
* @param orderHints |
|
309 |
* @param propertyPaths |
|
310 |
* @return |
|
311 |
*/ |
|
312 |
public <T extends SpecimenOrObservationBase> List<UuidAndTitleCache<SpecimenOrObservationBase>> listUuidAndTitleCacheByAssociatedTaxon(Class<T> type, Taxon associatedTaxon, |
|
313 |
Integer limit, Integer start, List<OrderHint> orderHints); |
|
314 |
|
|
281 | 315 |
/** |
282 | 316 |
* Retrieves all {@link IndividualsAssociation} with the given specimen.<br> |
283 | 317 |
* @param specimen the specimen for which the associations are retrieved |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IOccurrenceService.java | ||
---|---|---|
18 | 18 |
|
19 | 19 |
import org.apache.lucene.index.CorruptIndexException; |
20 | 20 |
import org.hibernate.search.spatial.impl.Rectangle; |
21 |
import org.springframework.transaction.annotation.Transactional; |
|
21 | 22 |
|
22 | 23 |
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade; |
23 | 24 |
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException; |
... | ... | |
623 | 624 |
*/ |
624 | 625 |
public List<FieldUnit> getFieldUnitsForGatheringEvent(UUID gatheringEventUuid); |
625 | 626 |
|
627 |
|
|
628 |
/** |
|
629 |
* Returns a list of {@link UuidAndTitleCache} for the specimens found with the |
|
630 |
* given configurator |
|
631 |
* @param config the configurator for the search |
|
632 |
* @return a list of UuidAndTitleCache object |
|
633 |
*/ |
|
634 |
@Transactional(readOnly = true) |
|
635 |
public Pager<UuidAndTitleCache<SpecimenOrObservationBase>> findByTitleUuidAndTitleCache( |
|
636 |
FindOccurrencesConfigurator config); |
|
637 |
|
|
626 | 638 |
} |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/OccurrenceServiceImpl.java | ||
---|---|---|
1372 | 1372 |
} |
1373 | 1373 |
} |
1374 | 1374 |
|
1375 |
@Override |
|
1376 |
public Pager<UuidAndTitleCache<SpecimenOrObservationBase>> findByTitleUuidAndTitleCache( |
|
1377 |
FindOccurrencesConfigurator config){ |
|
1378 |
List<UuidAndTitleCache<SpecimenOrObservationBase>> occurrences = new ArrayList<>(); |
|
1379 |
Taxon taxon = null; |
|
1380 |
if(config.getAssociatedTaxonUuid()!=null){ |
|
1381 |
TaxonBase taxonBase = taxonService.load(config.getAssociatedTaxonUuid()); |
|
1382 |
if(taxonBase.isInstanceOf(Taxon.class)){ |
|
1383 |
taxon = HibernateProxyHelper.deproxy(taxonBase, Taxon.class); |
|
1384 |
} |
|
1385 |
} |
|
1386 |
TaxonName taxonName = null; |
|
1387 |
if(config.getAssociatedTaxonNameUuid()!=null){ |
|
1388 |
taxonName = nameService.load(config.getAssociatedTaxonNameUuid()); |
|
1389 |
} |
|
1390 |
occurrences.addAll(dao.findOccurrencesUuidAndTitleCache(config.getClazz(), |
|
1391 |
config.getTitleSearchString(), config.getSignificantIdentifier(), |
|
1392 |
config.getSpecimenType(), taxon, taxonName, config.getMatchMode(), null, null, |
|
1393 |
config.getOrderHints())); |
|
1394 |
|
|
1395 |
return new DefaultPagerImpl<UuidAndTitleCache<SpecimenOrObservationBase>>(config.getPageNumber(), occurrences.size(), config.getPageSize(), occurrences); |
|
1396 |
} |
|
1397 |
|
|
1375 | 1398 |
@Override |
1376 | 1399 |
public Pager<SpecimenOrObservationBase> findByTitle( |
1377 | 1400 |
IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase> config) { |
Also available in: Unified diff
ref #7095 Add dao method for listing UuidAndTitleCache object