Commit bb95e5eb authored by Matija Obreza's avatar Matija Obreza

Fix: Taxonomy list filtering needs leftJoin

parent 9cf9adc0
......@@ -52,6 +52,7 @@ import org.springframework.transaction.annotation.Transactional;
import com.google.api.client.util.Lists;
import com.querydsl.core.BooleanBuilder;
import com.querydsl.jpa.impl.JPAQuery;
import com.querydsl.jpa.impl.JPAQueryFactory;
@Service
......@@ -238,7 +239,11 @@ public class TaxonomyServiceImpl implements TaxonomyService {
predicate.and(filter.buildPredicate());
}
List<Taxonomy2> matches = jpaQueryFactory.selectFrom(QTaxonomy2.taxonomy2).where(predicate).offset(page.getOffset()).limit(page.getPageSize()).orderBy(
JPAQuery<Taxonomy2> query = jpaQueryFactory.selectFrom(QTaxonomy2.taxonomy2);
query.leftJoin(QTaxonomy2.taxonomy2.grinTaxonomySpecies);
query.leftJoin(QTaxonomy2.taxonomy2.currentTaxonomySpecies);
List<Taxonomy2> matches = query.where(predicate).offset(page.getOffset()).limit(page.getPageSize()).orderBy(
QTaxonomy2.taxonomy2.accessions.size().desc(), QTaxonomy2.taxonomy2.taxonName.asc(), QTaxonomy2.taxonomy2.id.asc()).fetch();
final Page<Taxonomy2> res = taxonomy2Repository.findAll(predicate, page);
......
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