Project

General

Profile

Revision d43f4436

IDd43f4436cf7e600374dcd7c65c74792bab0aeda6
Parent 4ad81945
Child 777ccdd0

Added by Andreas Müller 5 months ago

ref #6581 adapt search in ReferenceDaoHibernateImpl

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/reference/ReferenceDaoHibernateImpl.java
305 305
			referenceSet.addAll(getSubordinateReferences(reference));
306 306
		}
307 307

  
308

  
309 308
		StringBuilder taxonDescriptionSql = new StringBuilder();
310 309
		taxonDescriptionSql.append(
311
			"select distinct t from Taxon t " +
310
			"SELECT DISTINCT t from Taxon t " +
312 311
			// TaxonDescription
313
			"left join t.descriptions td " +
314
			"left join td.descriptionSources td_s " +
315
			"left join td.descriptionElements td_e " +
316
			"left join td_e.sources td_e_s " +
312
			"LEFT JOIN t.descriptions td " +
313
			"LEFT JOIN td.descriptionSources td_s " +
314
			"LEFT JOIN td.descriptionElements td_e " +
315
			"LEFT JOIN td_e.sources td_e_s " +
317 316
			// TaxonNameDescription
318
			"left join t.name n " +
319
			"left join n.descriptions nd " +
320
			"left join nd.descriptionSources nd_s " +
321
			"left join nd.descriptionElements nd_e " +
322
			"left join nd_e.sources nd_e_s " +
323

  
324
			"where td_e_s.citation in (:referenceBase_1) " +
325
			"or td_s in (:referenceBase_2) " +
326
			"or nd_e_s.citation in (:referenceBase_3) " +
327
			"or nd_s in (:referenceBase_4) or " +
328
			"n.nomenclaturalReference in (:referenceBase_5) or " +
329
			"t.sec in (:referenceBase_6)"
317
			"LEFT JOIN t.name n " +
318
			"LEFT JOIN n.descriptions nd " +
319
			"LEFT JOIN nd.descriptionSources nd_s " +
320
			"LEFT JOIN nd.descriptionElements nd_e " +
321
			"LEFT JOIN nd_e.sources nd_e_s " +
322
			//nomenclatural citation
323
			"LEFT JOIN n.nomenclaturalSource ns " +
324

  
325
			"WHERE td_e_s.citation IN (:referenceBase_1) " +
326
			  " OR td_s IN (:referenceBase_2) " +
327
			  " OR nd_e_s.citation IN (:referenceBase_3) " +
328
			  " OR nd_s IN (:referenceBase_4) " +
329
			  " OR ns.citation IN (:referenceBase_5) " +
330
			  " OR t.sec IN (:referenceBase_6)"
330 331
			);
331 332

  
332 333
		if (orderHints != null && orderHints.size() > 0){

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)