Revision 670d72df
Added by Katja Luther almost 8 years ago
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/taxon/TaxonDaoHibernateImpl.java | ||
---|---|---|
1560 | 1560 |
public List<UuidAndTitleCache<TaxonNode>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification, List<UUID> excludeUuid) { |
1561 | 1561 |
|
1562 | 1562 |
int classificationId = classification.getId(); |
1563 |
StringBuffer excludeUuids = new StringBuffer(); |
|
1563 |
// StringBuffer excludeUuids = new StringBuffer();
|
|
1564 | 1564 |
|
1565 | 1565 |
|
1566 | 1566 |
String queryString = "SELECT nodes.uuid, nodes.id, taxa.titleCache FROM TaxonNode AS nodes, Taxon AS taxa WHERE nodes.taxon = taxa AND nodes.classification.id = " + classificationId ; |
1567 | 1567 |
@SuppressWarnings("unchecked") |
1568 | 1568 |
List<Object[]> result; |
1569 |
if (excludeUuid != null){
|
|
1569 |
if ( excludeUuid != null && !excludeUuid.isEmpty()){
|
|
1570 | 1570 |
queryString = queryString + " AND taxa.uuid NOT IN (:excludeUuid)" ; |
1571 | 1571 |
|
1572 | 1572 |
result = getSession().createQuery(queryString).setParameterList("excludeUuid", excludeUuid).list(); |
Also available in: Unified diff
check for empty excludeUuid list