Revision fd8e61f7
Added by Patrick Plitzner about 8 years ago
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/occurrence/OccurrenceDaoHibernateImpl.java | ||
---|---|---|
513 | 513 |
" from SpecimenOrObservationBase sob" + |
514 | 514 |
" where sob in (:setOfAll)"; |
515 | 515 |
|
516 |
if(type != null){ |
|
516 |
if(type != null && !type.equals(SpecimenOrObservationBase.class)){
|
|
517 | 517 |
queryString += " and sob.class = :type"; |
518 | 518 |
} |
519 | 519 |
|
... | ... | |
532 | 532 |
Query query = getSession().createQuery(queryString); |
533 | 533 |
query.setParameterList("setOfAll", setOfAll); |
534 | 534 |
|
535 |
if(type != null){ |
|
535 |
if(type != null && !type.equals(SpecimenOrObservationBase.class)){
|
|
536 | 536 |
query.setParameter("type", type.getSimpleName()); |
537 | 537 |
} |
538 | 538 |
|
... | ... | |
603 | 603 |
" from SpecimenOrObservationBase sob" + |
604 | 604 |
" where sob in (:setOfAll)"; |
605 | 605 |
|
606 |
if(type != null){ |
|
606 |
if(type != null && !type.equals(SpecimenOrObservationBase.class)){
|
|
607 | 607 |
queryString += " and sob.class = :type"; |
608 | 608 |
} |
609 | 609 |
|
... | ... | |
622 | 622 |
Query query = getSession().createQuery(queryString); |
623 | 623 |
query.setParameterList("setOfAll", setOfAll); |
624 | 624 |
|
625 |
if(type != null){ |
|
625 |
if(type != null && !type.equals(SpecimenOrObservationBase.class)){
|
|
626 | 626 |
query.setParameter("type", type.getSimpleName()); |
627 | 627 |
} |
628 | 628 |
|
Also available in: Unified diff
Also return all specimens belonging to sub classes when specifying
SpecimenOrObservationBase as type