Project

General

Profile

« Previous | Next » 

Revision e8a3d3c8

Added by Patrick Plitzner over 5 years ago

ref #5458 Fix potential SQL query syntax exception

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/util/CdmQueryFactory.java
22 22
import com.vaadin.data.util.sqlcontainer.query.FreeformQuery;
23 23
import com.vaadin.data.util.sqlcontainer.query.QueryDelegate;
24 24

  
25
import eu.etaxonomy.cdm.common.CdmUtils;
25 26
import eu.etaxonomy.cdm.model.common.Language;
26 27
import eu.etaxonomy.cdm.model.common.Representation;
27 28
import eu.etaxonomy.cdm.model.location.NamedArea;
......
103 104
        "LEFT OUTER JOIN DescriptionBase descr on descr.taxon_id = tb.id "+// # taxon <-> taxon description (not every taxon has a description)
104 105
        "LEFT OUTER JOIN DescriptionElementBase descrEl on descrEl.indescription_id = descr.id and descrEl.DTYPE = 'Distribution' "+// # distribution <-> description
105 106
        "LEFT OUTER JOIN DefinedTermBase statusTerm on statusTerm.id = descrEl.status_id "+
106
        "LEFT OUTER JOIN DefinedTermBase area on area.id = descrEl.area_id "+
107
        "WHERE tn.id IN ("+ idString +") ";
107
        "LEFT OUTER JOIN DefinedTermBase area on area.id = descrEl.area_id ";
108
        if(CdmUtils.isNotBlank(idString)){
109
        	FROM_QUERY += "WHERE tn.id IN ("+ idString +") ";
110
        }
108 111

  
109 112
        String GROUP_BY = " GROUP BY tb.uuid, tn.id ";
110 113

  

Also available in: Unified diff