Project

General

Profile

« Previous | Next » 

Revision eae56a30

Added by Andreas Müller over 3 years ago

ref #6581 update HQL and property paths and similar to nomenclaturalSource (some issues unclear)

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/statistics/StatisticsDaoHibernateImpl.java
385 385
    public Long countNomenclaturalReferences() {
386 386
		Query query = getSession()
387 387
				.createQuery(
388
						"select count(distinct nomenclaturalReference) from TaxonName ");
388
						" SELECT COUNT(DISTINCT ns.citation) "
389
						+ " FROM TaxonName n"
390
						+ " JOIN n.nomenclaturalSource ns ");
389 391
		return (Long) query.uniqueResult();
390 392
	}
391 393

  
......
406 408
		// and count the names manually
407 409
		List<String> queryStrings = new ArrayList<String>();
408 410
		queryStrings
409
				.add("SELECT DISTINCT tn.taxon.name.nomenclaturalReference.uuid "
411
				.add("SELECT DISTINCT tn.taxon.name.nomenclaturalSource.citation.uuid "
410 412
				        + " FROM TaxonNode tn "
411 413
						+ " WHERE tn.classification=:classification "
412
						+ " AND tn.taxon.name.nomenclaturalReference IS NOT NULL ");
414
						+ " AND tn.taxon.name.nomenclaturalSource.citation IS NOT NULL ");
413 415
		queryStrings
414
				.add("SELECT DISTINCT s.name.nomenclaturalReference.uuid as c "
416
				.add("SELECT DISTINCT s.name.nomenclaturalSource.citation.uuid as c "
415 417
				        + " FROM TaxonNode tn "
416 418
						+ " JOIN tn.taxon.synonyms as s "
417 419
						+ " WHERE tn.classification=:classification "
418
						+ "    AND s.name.nomenclaturalReference is not null ");
420
						+ "    AND s.name.nomenclaturalSource.citation is NOT NULL ");
419 421

  
420 422
		return Long.valueOf(processQueriesWithIdDistinctListResult(
421 423
				queryStrings, parameters).size());

Also available in: Unified diff