Commit f8ea3ade authored by Matija Obreza's avatar Matija Obreza

Fixed KML error on empty filters

parent a0fd0d58
......@@ -34,7 +34,6 @@ import org.genesys2.server.model.impl.Crop;
import org.genesys2.server.model.impl.FaoInstitute;
import org.genesys2.server.persistence.domain.AccessionRepository;
import org.genesys2.server.persistence.domain.MethodRepository;
import org.genesys2.server.persistence.domain.TraitValueRepository;
import org.genesys2.server.service.CropService;
import org.genesys2.server.service.FilterConstants;
import org.genesys2.server.service.GenesysFilterService;
......@@ -42,7 +41,6 @@ import org.genesys2.server.service.GenesysService;
import org.genesys2.server.service.GeoService;
import org.genesys2.server.service.InstituteService;
import org.genesys2.server.service.TaxonomyService;
import org.genesys2.server.service.TraitService;
import org.genesys2.server.service.impl.DirectMysqlQuery.MethodResolver;
import org.genesys2.server.service.impl.FilterHandler.AppliedFilter;
import org.genesys2.server.service.impl.FilterHandler.AppliedFilters;
......@@ -70,18 +68,12 @@ public class GenesysFilterServiceImpl implements GenesysFilterService {
@Autowired
private GenesysService genesysService;
@Autowired
private TraitValueRepository traitValueRepository;
@Autowired
private MethodRepository methodRepository;
@Autowired
private AccessionRepository accessionRepository;
@Autowired
private TraitService traitService;
@Autowired
private GeoService geoService;
......@@ -251,8 +243,9 @@ public class GenesysFilterServiceImpl implements GenesysFilterService {
final DirectMysqlQuery directQuery = new DirectMysqlQuery("accessiongeo", "geo");
directQuery.filterTile(zoom, xtile, ytile);
directQuery.innerJoin("accession", "a", "a.id=geo.accessionId");
if (!filters.isEmpty()) {
directQuery.innerJoin("accession", "a", "a.id=geo.accessionId");
directQuery.join(filters);
directQuery.filter(filters, new MethodResolver() {
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment